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
115 ##########################################################
116 # true life test: run parts as direct client
117 ##########################################################
121 --log-file=$R/valgrind.out \
122 --trace-children=no \
125 --show-leak-kinds=all \
127 $R/bin/afb-daemon-cov \
138 --log error,warning,notice,info,debug,critical,alert-error,warning,notice,info,debug,critical,alert+error,warning,notice,info,debug,critical,alert \
145 --alias /icons:$R/www \
152 --ldpaths $R/ldpath/strong \
153 --binding $R/bin/demat.so \
154 --auto-api $R/apis/auto \
164 --set hello/key:a-kind-of-text \
165 --call demat/ping:true \
166 --call hello/ping:false \
167 --ws-server unix:$R/apis/ws/hello \
168 --ws-server unix:$R/apis/ws/salut \
169 --exec $R/scripts/run-parts.sh @p @t
172 ##########################################################
173 # true life test: run parts as in-direct server
174 ##########################################################
178 --log-file=$R/valgrind.out \
179 --trace-children=no \
182 --show-leak-kinds=all \
184 $R/bin/afb-daemon-cov \
189 --alias /icons:$R/www \
194 --ldpaths $R/ldpath/strong \
195 --binding $R/bin/demat.so \
196 --auto-api $R/apis/auto \
198 --ws-server unix:$R/apis/ws/hello \
199 --ws-server unix:$R/apis/ws/salut \
200 --ws-server localhost:9595/salut \
202 $R/bin/afb-daemon-nocov \
206 --auto-api $R/apis/auto \
207 --auto-api $R/apis/ws \
208 --ws-client localhost:9595/salut2 \
209 --exec $R/scripts/run-parts.sh @@p @@t
212 ##########################################################
213 # true life test: run parts as in-direct client
214 ##########################################################
218 --log-file=$R/valgrind.out \
219 --trace-children=no \
222 --show-leak-kinds=all \
224 $R/bin/afb-daemon-nocov \
229 --alias /icons:$R/www \
234 --ldpaths $R/ldpath/strong \
235 --binding $R/bin/demat.so \
236 --auto-api $R/apis/auto \
238 --ws-server unix:$R/apis/ws/hello \
239 --ws-server unix:$R/apis/ws/salut \
240 --ws-server localhost:9595/salut \
242 $R/bin/afb-daemon-cov \
246 --auto-api $R/apis/auto \
247 --auto-api $R/apis/ws \
248 --ws-client localhost:9595/salut2 \
249 --exec $R/scripts/run-parts.sh @@p @@t