1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

testServer modularizing

This commit is contained in:
tg(x) 2011-05-14 18:21:00 +02:00
parent d950bafa84
commit 3c9d7438a8
5 changed files with 58 additions and 44 deletions

View file

@ -4,7 +4,8 @@ CFLAGS = -I../include -I../src -Wall -std=c99 ${OPT}
LDFLAGS = -L../lib
LOADLIBES = -lpsyc -lm
LOADLIBES_NET = ${LOADLIBES}
TARGETS = testServer testParser testMatch testRender testText isRoutingVar getVarType
TARGETS = testServerPsyc testParser testMatch testRender testText isRoutingVar getVarType
O = testServer.o
WRAPPER =
DIET = diet
PORT = 4440
@ -19,7 +20,8 @@ endif
all: ${TARGETS}
it: all
testServer: LOADLIBES := ${LOADLIBES_NET}
testServerPsyc: LOADLIBES := ${LOADLIBES_NET}
testServerPsyc: testServer.o
diet: WRAPPER = ${DIET}
diet: all
@ -29,7 +31,7 @@ debug: CFLAGS := $(subst ${OPT},-O0,${CFLAGS})
debug: all
clean:
rm -f ${TARGETS}
rm -f ${TARGETS} $O
test: ${TARGETS}
./testRender
@ -47,12 +49,12 @@ nettest: nettestfull nettestsplit
nettestrun: srvstart pkt srvkill
nettestfull:
${MAKE} nettestrun; x=$$?; pkill -x testServer; exit $$x
${MAKE} nettestrun srv_args=r; x=$$?; pkill -x testServer; exit $$x
${MAKE} nettestrun; x=$$?; pkill -x testServerPsyc; exit $$x
${MAKE} nettestrun srv_args=r; x=$$?; pkill -x testServerPsyc; exit $$x
split_max = 10
nettestsplit:
x=0; for n in `seq 1 ${split_max}`; do ${MAKE} nettestrun srv_recvbuf=$$n && ${MAKE} nettestrun srv_args=r srv_recvbuf=$$n || break; done; x=$$?; pkill -x testServer; exit $$x
x=0; for n in `seq 1 ${split_max}`; do ${MAKE} nettestrun srv_recvbuf=$$n && ${MAKE} nettestrun srv_args=r srv_recvbuf=$$n || break; done; x=$$?; pkill -x testServerPsyc; exit $$x
pkt:
x=0; for f in packets/[0-9]*; do echo ">> $$f"; cat $$f | nc localhost ${PORT} | ${DIFF} -u $$f -; x=$$((x+$$?)); done; exit $$x
@ -64,8 +66,8 @@ pkterr:
for f in packets/err-*; do echo ">> $$f"; cat $$f | nc localhost ${PORT}; done
srvstart:
pkill -x testServer; exit 0
./testServer ${PORT} -${srv_args} ${srv_recvbuf} &
pkill -x testServerPsyc; exit 0
./testServerPsyc ${PORT} -${srv_args} ${srv_recvbuf} &
srvkill:
pkill -x testServer
pkill -x testServerPsyc