3 export R=$(realpath $(dirname $0)/..)
4 export PATH="$R/bin:$R/scripts:$PATH"
8 lcov -c -i -d $R/bin -o $R/lcov-out.info
11 if [[ -z "$NOVALGRIND" ]]; then
26 echo "*******************************************************************"
28 echo "*******************************************************************"
29 lcov -c -i -d $R/bin -o $R/fake.info
33 lcov -c -d $R/bin -o $R/tmp.info
34 mv $R/lcov-out.info $R/previous.info
35 lcov -a $R/tmp.info -a $R/previous.info -o $R/lcov-out.info
36 rm $R/previous.info $R/fake.info $R/tmp.info
55 export AFB_LDPATHS=/tmp/ldpaths
56 export AFB_TRACEAPI=no
59 ##########################################################
60 # test to check options
61 ##########################################################
63 mk $R/bin/afb-daemon-cov --help
65 mk $R/bin/afb-daemon-cov --version
67 mk $R/bin/afb-daemon-cov --no-httpd --fake-option
69 mk $R/bin/afb-daemon-cov --daemon --session-max
71 mk $R/bin/afb-daemon-cov --ws-client fake --session-max toto
73 mk $R/bin/afb-daemon-cov --foreground --port -55
75 mk $R/bin/afb-daemon-cov --foreground --port 9999999
77 mk $R/bin/afb-daemon-cov --no-ldpath --traceapi fake
79 mk $R/bin/afb-daemon-cov --traceditf all --tracesvc all --log error,alarm
81 mk $R/bin/afb-daemon-cov --call noapi/noverb:false
83 mk $R/bin/afb-daemon-cov --call not-a-call
85 LISTEN_FDNAMES=toto,demat LISTEN_FDS=5
86 typeset -x LISTEN_FDNAMES LISTEN_FDS
87 mk $R/bin/afb-daemon-cov --no-ldpath --binding $R/bin/demat.so --ws-server sd:demat --call "demat/exit:0"
88 typeset +x LISTEN_FDNAMES LISTEN_FDS
90 mk $R/bin/afb-daemon-cov --weak-ldpaths $R/ldpath/weak --binding $R/bin/demat.so --ws-server sd:demat --call "demat/exit:0"
92 AFB_DEBUG_BREAK=zero,one,two,main-start AFB_DEBUG_WAIT="here I am,main-args"
93 typeset -x AFB_DEBUG_BREAK AFB_DEBUG_WAIT
94 mkdbgwait $R/bin/afb-daemon-cov --rootdir $R/i-will-never-exist
95 typeset +x AFB_DEBUG_BREAK AFB_DEBUG_WAIT
97 mk $R/bin/afb-daemon-cov --workdir=/etc/you/should/not/be/able/to/create/me
99 mk $R/bin/afb-daemon-cov --exec $R/it-doesn-t-exist
102 ##########################################################
104 ##########################################################
106 mk $R/bin/test-apiset
108 mk $R/bin/test-session
110 mk $R/bin/test-wrap-json
113 ##########################################################
114 # true life test: run parts as direct client
115 ##########################################################
119 --log-file=$R/valgrind.out \
120 --trace-children=no \
123 --show-leak-kinds=all \
125 $R/bin/afb-daemon-cov \
136 --log error,warning,notice,info,debug,critical,alert-error,warning,notice,info,debug,critical,alert+error,warning,notice,info,debug,critical,alert \
143 --alias /icons:$R/www \
150 --ldpaths $R/ldpath/strong \
151 --binding $R/bin/demat.so \
152 --auto-api $R/apis/auto \
162 --set hello/key:a-kind-of-text \
163 --call demat/ping:true \
164 --call hello/ping:false \
165 --ws-server unix:$R/apis/ws/hello \
166 --ws-server unix:$R/apis/ws/salut \
167 --exec $R/scripts/run-parts.sh @p @t
170 ##########################################################
171 # true life test: run parts as in-direct server
172 ##########################################################
176 --log-file=$R/valgrind.out \
177 --trace-children=no \
180 --show-leak-kinds=all \
182 $R/bin/afb-daemon-cov \
187 --alias /icons:$R/www \
192 --ldpaths $R/ldpath/strong \
193 --binding $R/bin/demat.so \
194 --auto-api $R/apis/auto \
196 --ws-server unix:$R/apis/ws/hello \
197 --ws-server unix:$R/apis/ws/salut \
198 --ws-server localhost:9595/salut \
200 $R/bin/afb-daemon-nocov \
204 --auto-api $R/apis/auto \
205 --auto-api $R/apis/ws \
206 --ws-client localhost:9595/salut2 \
207 --exec $R/scripts/run-parts.sh @@p @@t
210 ##########################################################
211 # true life test: run parts as in-direct client
212 ##########################################################
216 --log-file=$R/valgrind.out \
217 --trace-children=no \
220 --show-leak-kinds=all \
222 $R/bin/afb-daemon-nocov \
227 --alias /icons:$R/www \
232 --ldpaths $R/ldpath/strong \
233 --binding $R/bin/demat.so \
234 --auto-api $R/apis/auto \
236 --ws-server unix:$R/apis/ws/hello \
237 --ws-server unix:$R/apis/ws/salut \
238 --ws-server localhost:9595/salut \
240 $R/bin/afb-daemon-cov \
244 --auto-api $R/apis/auto \
245 --auto-api $R/apis/ws \
246 --ws-client localhost:9595/salut2 \
247 --exec $R/scripts/run-parts.sh @@p @@t