u16id: Add maps for identifiers id of 16 bits
[src/app-framework-binder.git] / coverage / scripts / run-test.sh
index 5d1b9a9..e7fc1b5 100755 (executable)
@@ -7,26 +7,59 @@ cd $R/bin
 
 lcov -c -i -d $R/bin -o $R/lcov-out.info
 
-mk() {
+vg() {
+       if [[ -z "$NOVALGRIND" ]]; then
+               valgrind "$@"
+       else
+               while :; do
+                       case "$1" in
+                       --*) shift;;
+                       *) break;;
+                       esac
+               done
+               "$@"
+       fi
+}
+
+mkbefore() {
        echo
        echo "*******************************************************************"
        echo "** $*"
        echo "*******************************************************************"
        lcov -c -i -d $R/bin -o $R/fake.info
-       "$@"
+}
+
+mkafter() {
        lcov -c -d $R/bin -o $R/tmp.info
        mv $R/lcov-out.info $R/previous.info
        lcov -a $R/tmp.info -a $R/previous.info -o $R/lcov-out.info
        rm $R/previous.info $R/fake.info  $R/tmp.info
 }
 
+mk() {
+       mkbefore "$@"
+       "$@"
+       mkafter "$@"
+}
+
+mkdbgwait() {
+       mkbefore "$@"
+       "$@" &
+       sleep 1
+       kill -INT %%
+       sleep 1
+       mkafter "$@"
+}
+
 mkdir /tmp/ldpaths
 export AFB_LDPATHS=/tmp/ldpaths
 export AFB_TRACEAPI=no
 
+echo '
 ##########################################################
 # test to check options
 ##########################################################
+'
 mk $R/bin/afb-daemon-cov --help
 
 mk $R/bin/afb-daemon-cov --version
@@ -56,29 +89,35 @@ typeset +x LISTEN_FDNAMES LISTEN_FDS
 
 mk $R/bin/afb-daemon-cov --weak-ldpaths $R/ldpath/weak --binding $R/bin/demat.so --ws-server sd:demat --call "demat/exit:0"
 
-AFB_DEBUG_BREAK=zero,one,two,main-start  AFB_DEBUG_WAIT="here I am"
+AFB_DEBUG_BREAK=zero,one,two,main-start  AFB_DEBUG_WAIT="here I am,main-args"
 typeset -x AFB_DEBUG_BREAK AFB_DEBUG_WAIT
-mk $R/bin/afb-daemon-cov --rootdir $R/i-will-never-exist
+mkdbgwait $R/bin/afb-daemon-cov --rootdir $R/i-will-never-exist
 typeset +x AFB_DEBUG_BREAK AFB_DEBUG_WAIT
 
 mk $R/bin/afb-daemon-cov --workdir=/etc/you/should/not/be/able/to/create/me
 
 mk $R/bin/afb-daemon-cov --exec $R/it-doesn-t-exist
 
+echo '
 ##########################################################
 # test of the bench
 ##########################################################
+'
 mk $R/bin/test-apiset
 
 mk $R/bin/test-session
 
 mk $R/bin/test-wrap-json
 
+mk $R/bin/test-u16id
+
+echo '
 ##########################################################
-# true life test
+# true life test: run parts as direct client
 ##########################################################
+'
 mk \
-valgrind \
+vg \
        --log-file=$R/valgrind.out \
        --trace-children=no \
        --track-fds=yes \
@@ -122,17 +161,20 @@ $R/bin/afb-daemon-cov \
        --traceevt all \
        --traceglob none \
        --monitoring \
+       --set hello/key:a-kind-of-text \
        --call demat/ping:true \
        --call hello/ping:false \
        --ws-server unix:$R/apis/ws/hello \
        --ws-server unix:$R/apis/ws/salut \
        --exec $R/scripts/run-parts.sh @p @t
 
+echo '
 ##########################################################
-# true life test
+# true life test: run parts as in-direct server
 ##########################################################
+'
 mk \
-valgrind \
+vg \
        --log-file=$R/valgrind.out \
        --trace-children=no \
        --track-fds=yes \
@@ -140,6 +182,46 @@ valgrind \
        --show-leak-kinds=all \
        --num-callers=50 \
 $R/bin/afb-daemon-cov \
+       --foreground \
+       --verbose \
+       --verbose \
+       --roothttp $R/www \
+       --alias /icons:$R/www \
+       --workdir . \
+       --uploaddir . \
+       --rootdir . \
+       --port 8888 \
+       --ldpaths $R/ldpath/strong \
+       --binding $R/bin/demat.so \
+       --auto-api $R/apis/auto \
+       --random-token \
+       --ws-server unix:$R/apis/ws/hello \
+       --ws-server unix:$R/apis/ws/salut \
+       --ws-server localhost:9595/salut \
+       --exec \
+           $R/bin/afb-daemon-nocov \
+               --quiet \
+               --quiet \
+               --port 9999 \
+               --auto-api $R/apis/auto \
+               --auto-api $R/apis/ws \
+               --ws-client localhost:9595/salut2 \
+               --exec $R/scripts/run-parts.sh @@p @@t
+
+echo '
+##########################################################
+# true life test: run parts as in-direct client
+##########################################################
+'
+mk \
+vg \
+       --log-file=$R/valgrind.out \
+       --trace-children=no \
+       --track-fds=yes \
+       --leak-check=full \
+       --show-leak-kinds=all \
+       --num-callers=50 \
+$R/bin/afb-daemon-nocov \
        --quiet \
        --quiet \
        --foreground \
@@ -148,6 +230,7 @@ $R/bin/afb-daemon-cov \
        --workdir . \
        --uploaddir . \
        --rootdir . \
+       --port 8888 \
        --ldpaths $R/ldpath/strong \
        --binding $R/bin/demat.so \
        --auto-api $R/apis/auto \
@@ -156,11 +239,14 @@ $R/bin/afb-daemon-cov \
        --ws-server unix:$R/apis/ws/salut \
        --ws-server localhost:9595/salut \
        --exec \
-            afb-daemon \
+           $R/bin/afb-daemon-cov \
+               --port 9999 \
+               --verbose \
+               --verbose \
                --auto-api $R/apis/auto \
                --auto-api $R/apis/ws \
-               --ws-client localhost:@p/salut2 \
-               $R/scripts/run-parts.sh @@p @@t
+               --ws-client localhost:9595/salut2 \
+               --exec $R/scripts/run-parts.sh @@p @@t
 
 exit 0