summaryrefslogtreecommitdiffstats
path: root/coverage/scripts/run-test.sh
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2018-07-12 10:59:48 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-07-24 16:28:32 +0200
commite17ae412245ba9afb33ff6a0f1f665b4d66d4da4 (patch)
tree698628c58b541007033ede6b4343dae921214da6 /coverage/scripts/run-test.sh
parent4c0f6ce66c66d39dc61ec661d88277c51d2fd9ae (diff)
coverage and test: Add tests
coverage values: - lines: 70.5 % - functions: 76.3 % Change-Id: Iaf802e84bbfa57502bbbac8c3b567b14c01608b6 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'coverage/scripts/run-test.sh')
-rwxr-xr-xcoverage/scripts/run-test.sh65
1 files changed, 60 insertions, 5 deletions
diff --git a/coverage/scripts/run-test.sh b/coverage/scripts/run-test.sh
index 34c2d303..bac4da5e 100755
--- a/coverage/scripts/run-test.sh
+++ b/coverage/scripts/run-test.sh
@@ -3,18 +3,72 @@
export R=$(realpath $(dirname $0)/..)
export PATH="$R/bin:$R/scripts:$PATH"
-$R/bin/afb-daemon-cov --help > /dev/null
+cd $R/bin
-$R/bin/afb-daemon-cov --version > /dev/null
+lcov -c -i -d $R/bin -o $R/lcov-out.info
-$R/bin/afb-daemon-cov --fake-option > /dev/null
+mk() {
+ echo
+ echo "*******************************************************************"
+ echo "** $*"
+ echo "*******************************************************************"
+ lcov -c -i -d $R/bin -o $R/fake.info
+ "$@"
+ 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
+}
+mkdir /tmp/ldpaths
+export AFB_LDPATHS=/tmp/ldpaths
+export AFB_TRACEAPI=no
+
+##########################################################
+# test to check options
+##########################################################
+mk $R/bin/afb-daemon-cov --help
+
+mk $R/bin/afb-daemon-cov --version
+
+mk $R/bin/afb-daemon-cov --no-httpd --fake-option
+
+mk $R/bin/afb-daemon-cov --daemon --session-max
+
+mk $R/bin/afb-daemon-cov --ws-client fake --session-max toto
+
+mk $R/bin/afb-daemon-cov --foreground --port -55
+
+mk $R/bin/afb-daemon-cov --foreground --port 9999999
+
+mk $R/bin/afb-daemon-cov --no-ldpath --traceapi fake
+
+mk $R/bin/afb-daemon-cov --traceditf all --tracesvc all --log error,alarm
+
+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"
+
+mk $R/bin/afb-daemon-cov --weak-ldpaths $R/ldpath/weak --binding $R/bin/demat.so --ws-server sd:demat --call "demat/exit:0"
+
+##########################################################
+# test of the bench
+##########################################################
+mk $R/bin/test-apiset
+
+mk $R/bin/test-session
+
+mk $R/bin/test-wrap-json
+
+##########################################################
+# true life test
+##########################################################
+mk \
valgrind \
--log-file=$R/valgrind.out \
--trace-children=no \
--track-fds=yes \
--leak-check=full \
- --show-leak-kinds=all \
+ --show-leak-kinds=all \
+ --num-callers=50 \
$R/bin/afb-daemon-cov \
--verbose \
--verbose \
@@ -29,6 +83,7 @@ $R/bin/afb-daemon-cov \
--log error,warning,notice,info,debug,critical,alert-error,warning,notice,info,debug,critical,alert+error,warning,notice,info,debug,critical,alert \
--foreground \
--name binder-cov \
+ --port 8888 \
--roothttp $R/www \
--rootbase /opx \
--rootapi /api \
@@ -41,7 +96,6 @@ $R/bin/afb-daemon-cov \
--rootdir . \
--ldpaths $R/ldpath/strong \
--binding $R/bin/demat.so \
- --weak-ldpaths $R/ldpath/weak \
--auto-api $R/apis/auto \
--token HELLO \
--random-token \
@@ -50,6 +104,7 @@ $R/bin/afb-daemon-cov \
--traceapi all \
--traceses all \
--traceevt all \
+ --monitoring \
--call demat/ping:true \
--ws-server unix:$R/apis/ws/hello \
--ws-server unix:$R/apis/ws/salut \