coverage and test: Add tests
[src/app-framework-binder.git] / coverage / scripts / run-test.sh
1 #!/bin/sh
2
3 export R=$(realpath $(dirname $0)/..)
4 export PATH="$R/bin:$R/scripts:$PATH"
5
6 cd $R/bin
7
8 lcov -c -i -d $R/bin -o $R/lcov-out.info
9
10 mk() {
11         echo
12         echo "*******************************************************************"
13         echo "** $*"
14         echo "*******************************************************************"
15         lcov -c -i -d $R/bin -o $R/fake.info
16         "$@"
17         lcov -c -d $R/bin -o $R/tmp.info
18         mv $R/lcov-out.info $R/previous.info
19         lcov -a $R/tmp.info -a $R/previous.info -o $R/lcov-out.info
20         rm $R/previous.info $R/fake.info  $R/tmp.info
21 }
22
23 mkdir /tmp/ldpaths
24 export AFB_LDPATHS=/tmp/ldpaths
25 export AFB_TRACEAPI=no
26
27 ##########################################################
28 # test to check options
29 ##########################################################
30 mk $R/bin/afb-daemon-cov --help
31
32 mk $R/bin/afb-daemon-cov --version
33
34 mk $R/bin/afb-daemon-cov --no-httpd --fake-option
35
36 mk $R/bin/afb-daemon-cov --daemon --session-max
37
38 mk $R/bin/afb-daemon-cov --ws-client fake --session-max toto
39
40 mk $R/bin/afb-daemon-cov --foreground --port -55
41
42 mk $R/bin/afb-daemon-cov --foreground --port 9999999
43
44 mk $R/bin/afb-daemon-cov --no-ldpath --traceapi fake
45
46 mk $R/bin/afb-daemon-cov --traceditf all --tracesvc all --log error,alarm
47
48 LISTEN_FDNAMES=toto,demat LISTEN_FDS=5 mk $R/bin/afb-daemon-cov --no-ldpath --binding $R/bin/demat.so --ws-server sd:demat --call "demat/exit:0"
49
50 mk $R/bin/afb-daemon-cov --weak-ldpaths $R/ldpath/weak --binding $R/bin/demat.so --ws-server sd:demat --call "demat/exit:0"
51
52 ##########################################################
53 # test of the bench
54 ##########################################################
55 mk $R/bin/test-apiset
56
57 mk $R/bin/test-session
58
59 mk $R/bin/test-wrap-json
60
61 ##########################################################
62 # true life test
63 ##########################################################
64 mk \
65 valgrind \
66         --log-file=$R/valgrind.out \
67         --trace-children=no \
68         --track-fds=yes \
69         --leak-check=full \
70         --show-leak-kinds=all \
71         --num-callers=50 \
72 $R/bin/afb-daemon-cov \
73         --verbose \
74         --verbose \
75         --verbose \
76         --verbose \
77         --quiet \
78         --quiet \
79         --quiet \
80         --quiet \
81         --quiet \
82         --quiet \
83         --log error,warning,notice,info,debug,critical,alert-error,warning,notice,info,debug,critical,alert+error,warning,notice,info,debug,critical,alert \
84         --foreground \
85         --name binder-cov \
86         --port 8888 \
87         --roothttp $R/www \
88         --rootbase /opx \
89         --rootapi /api \
90         --alias /icons:$R/www \
91         --apitimeout 90 \
92         --cntxtimeout 3600 \
93         --cache-eol 200 \
94         --workdir . \
95         --uploaddir . \
96         --rootdir . \
97         --ldpaths $R/ldpath/strong \
98         --binding $R/bin/demat.so \
99         --auto-api $R/apis/auto \
100         --token HELLO \
101         --random-token \
102         --session-max 1000 \
103         --tracereq all \
104         --traceapi all \
105         --traceses all \
106         --traceevt all \
107         --monitoring \
108         --call demat/ping:true \
109         --ws-server unix:$R/apis/ws/hello \
110         --ws-server unix:$R/apis/ws/salut \
111         --exec $R/scripts/run-parts.sh @p @t
112
113 exit 0
114