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

refactoring - renamed functions

This commit is contained in:
tg(x) 2011-10-31 20:04:16 +01:00
parent 0a95b0a518
commit 260bba0c46
37 changed files with 570 additions and 691 deletions

View file

@ -3,7 +3,7 @@ DEBUG = 2
CFLAGS = -I../include -I../src -Wall -std=c99 ${OPT}
LDFLAGS = -L../lib
LOADLIBES = -lpsyc -lm
TARGETS = testPsyc testPsycSpeed testParser testMatch testRender testText isRoutingVar getVarType parseUniform
TARGETS = test_psyc test_psyc_speed test_parser test_match test_render test_text var_is_routing var_type uniform_parse
O = test.o
WRAPPER =
DIET = diet
@ -20,16 +20,16 @@ endif
all: ${TARGETS}
it: all
testPsyc: LOADLIBES := ${LOADLIBES} ${LOADLIBES_NET}
testPsycSpeed: LOADLIBES := ${LOADLIBES} ${LOADLIBES_NET}
#testPsycSpeed: LOADLIBES := ${LOADLIBES_NET}
test_psyc: LOADLIBES := ${LOADLIBES} ${LOADLIBES_NET}
test_psyc_speed: LOADLIBES := ${LOADLIBES} ${LOADLIBES_NET}
#test_psyc_speed: LOADLIBES := ${LOADLIBES_NET}
testJson: LOADLIBES := ${LOADLIBES_NET} -ljson
test_json: LOADLIBES := ${LOADLIBES_NET} -ljson
testJsonGlib: CFLAGS := ${CFLAGS} -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
testJsonGlib: LOADLIBES := ${LOADLIBES_NET} -ljson-glib-1.0
test_json_glib: CFLAGS := ${CFLAGS} -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
test_json_glib: LOADLIBES := ${LOADLIBES_NET} -ljson-glib-1.0
testStrlen: LOADLIBES := ${LOADLIBES_NET}
test_strlen: LOADLIBES := ${LOADLIBES_NET}
diet: WRAPPER = ${DIET}
diet: all
@ -42,14 +42,14 @@ clean:
rm -f ${TARGETS} $O
test: ${TARGETS}
./testRender
./testMatch
./testText
./isRoutingVar
./getVarType
./parseUniform
x=0; for f in packets/[0-9]*; do echo ">> $$f"; ./testPsyc -f $$f | ${DIFF} -u $$f -; x=$$((x+$$?)); done; exit $$x
x=0; for f in packets/[0-9]*; do echo ">> $$f"; ./testPsyc -rf $$f | ${DIFF} -u $$f -; x=$$((x+$$?)); done; exit $$x
./test_render
./test_match
./test_text
./var_is_routing
./var_type
./uniform_parse
x=0; for f in packets/[0-9]*; do echo ">> $$f"; ./test_psyc -f $$f | ${DIFF} -u $$f -; x=$$((x+$$?)); done; exit $$x
x=0; for f in packets/[0-9]*; do echo ">> $$f"; ./test_psyc -rf $$f | ${DIFF} -u $$f -; x=$$((x+$$?)); done; exit $$x
.NOTPARALLEL: nettestrun
@ -58,12 +58,12 @@ nettest: nettestfull nettestsplit
nettestrun: srvstart pkt srvkill
nettestfull:
${MAKE} nettestrun; x=$$?; pkill -x testPsyc; exit $$x
${MAKE} nettestrun srv_args=-r; x=$$?; pkill -x testPsyc; exit $$x
${MAKE} nettestrun; x=$$?; pkill -x test_psyc; exit $$x
${MAKE} nettestrun srv_args=-r; x=$$?; pkill -x test_psyc; exit $$x
split_max = 10
nettestsplit:
x=0; for n in `seq 1 ${split_max}`; do ${MAKE} nettestrun srv_args="-b $$n" && ${MAKE} nettestrun srv_args="-r -b $$n" || break; done; x=$$?; pkill -x testPsyc; exit $$x
x=0; for n in `seq 1 ${split_max}`; do ${MAKE} nettestrun srv_args="-b $$n" && ${MAKE} nettestrun srv_args="-r -b $$n" || break; done; x=$$?; pkill -x test_psyc; 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
@ -75,37 +75,37 @@ pkterr:
for f in packets/err-*; do echo ">> $$f"; cat $$f | nc localhost ${PORT}; done
srvstart:
pkill -x testPsyc; exit 0
./testPsyc -p ${PORT} -S ${srv_args} &
pkill -x test_psyc; exit 0
./test_psyc -p ${PORT} -S ${srv_args} &
srvkill:
pkill -x testPsyc
pkill -x test_psyc
bench: bench-genpkts bench-psyc bench-psyc-bin bench-json bench-json-bin bench-xml
bench-dir:
@mkdir -p ../bench/results
bench-psyc: bench-dir testStrlen testPsycSpeed
for f in ../bench/packets/*.psyc; do bf=`basename $$f`; echo strlen: $$bf; ./testStrlen -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf.strlen; done
for f in ../bench/packets/*.psyc; do bf=`basename $$f`; echo libpsyc: $$f; ./testPsycSpeed -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf; done
bench-psyc: bench-dir test_strlen test_psyc_speed
for f in ../bench/packets/*.psyc; do bf=`basename $$f`; echo strlen: $$bf; ./test_strlen -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf.strlen; done
for f in ../bench/packets/*.psyc; do bf=`basename $$f`; echo libpsyc: $$f; ./test_psyc_speed -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf; done
bench-psyc-bin: bench-dir testStrlen testPsycSpeed
for f in `ls ../bench/packets/binary/*.psyc | sort -r`; do bf=`basename $$f`; echo "libpsyc: $$f * 1000000"; ./testPsycSpeed -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf; done
c=1000000; for f in `ls ../bench/packets/binary/*.psyc | sort -r`; do bf=`basename $$f`; echo "strlen: $$bf * $$c"; ./testStrlen -sc $$c -f $$f | ${TEE} -a ../bench/results/$$bf.strlen; c=$$((c/10)); done
bench-psyc-bin: bench-dir test_strlen test_psyc_speed
for f in `ls ../bench/packets/binary/*.psyc | sort -r`; do bf=`basename $$f`; echo "libpsyc: $$f * 1000000"; ./test_psyc_speed -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf; done
c=1000000; for f in `ls ../bench/packets/binary/*.psyc | sort -r`; do bf=`basename $$f`; echo "strlen: $$bf * $$c"; ./test_strlen -sc $$c -f $$f | ${TEE} -a ../bench/results/$$bf.strlen; c=$$((c/10)); done
bench-json: bench-dir testJson testJsonGlib
# for f in ../bench/packets/*.json; do bf=`basename $$f`; echo strlen: $$bf; ./testStrlen -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf.strlen; done
for f in ../bench/packets/*.json; do bf=`basename $$f`; echo json-c: $$bf; ./testJson -snc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf; done
for f in ../bench/packets/*.json; do bf=`basename $$f`; echo json-glib: $$bf; ./testJsonGlib -snc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf-glib; done
bench-json: bench-dir test_json test_json_glib
# for f in ../bench/packets/*.json; do bf=`basename $$f`; echo strlen: $$bf; ./test_strlen -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf.strlen; done
for f in ../bench/packets/*.json; do bf=`basename $$f`; echo json-c: $$bf; ./test_json -snc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf; done
for f in ../bench/packets/*.json; do bf=`basename $$f`; echo json-glib: $$bf; ./test_json_glib -snc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf-glib; done
bench-json-bin: bench-dir testJson testJsonGlib
c=1000000; for f in `ls ../bench/packets/binary/*.json | sort -r`; do bf=`basename $$f`; echo "json-c: $$bf * $$c"; ./testJson -snc $$c -f $$f | ${TEE} -a ../bench/results/$$bf; c=$$((c/10)); done
c=1000000; for f in `ls ../bench/packets/binary/*.json | sort -r`; do bf=`basename $$f`; echo "json-glib: $$bf * $$c"; ./testJsonGlib -snc $$c -f $$f | ${TEE} -a ../bench/results/$$bf-glib; c=$$((c/10)); done
bench-json-bin: bench-dir test_json test_json_glib
c=1000000; for f in `ls ../bench/packets/binary/*.json | sort -r`; do bf=`basename $$f`; echo "json-c: $$bf * $$c"; ./test_json -snc $$c -f $$f | ${TEE} -a ../bench/results/$$bf; c=$$((c/10)); done
c=1000000; for f in `ls ../bench/packets/binary/*.json | sort -r`; do bf=`basename $$f`; echo "json-glib: $$bf * $$c"; ./test_json_glib -snc $$c -f $$f | ${TEE} -a ../bench/results/$$bf-glib; c=$$((c/10)); done
bench-xml: bench-dir
@[[ -n "${xmlbench}" ]] || (echo xmlbench path needs to be set with xmlbench=/path/to/xmlbench; exit 1)
# for f in ../bench/packets/*.xml; do bf=`basename $$f`; echo strlen: $$bf; ./testStrlen -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf.strlen; done
# for f in ../bench/packets/*.xml; do bf=`basename $$f`; echo strlen: $$bf; ./test_strlen -sc 1000000 -f $$f | ${TEE} -a ../bench/results/$$bf.strlen; done
for f in ../bench/packets/*.xml; do bf=`basename $$f`; echo libxml: $$bf; ${xmlbench}/parse/libxml 1000000 $$f | ${TEE} -a ../bench/results/$$bf-libxml; done
for f in ../bench/packets/*.xml; do bf=`basename $$f`; echo libxml-sax: $$bf; ${xmlbench}/parse/libxml-sax 1000000 $$f | ${TEE} -a ../bench/results/$$bf-libxml-sax; done
for f in ../bench/packets/*.xml; do bf=`basename $$f`; echo rapidxml: $$bf; ${xmlbench}/parse/rapidxml 1000000 $$f | ${TEE} -a ../bench/results/$$bf-rapidxml; done