From 5d57096e3682083c20b2a0fd3ddb9ef75148a94e Mon Sep 17 00:00:00 2001 From: José Bollo Date: Tue, 30 Apr 2019 22:39:33 +0200 Subject: coverage: Add test of AFB_DEBUG_WAIT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug-AGL: SPEC-1130 Change-Id: I349c141015e3851ddecd4a6df7497d8ef4cceaa6 Signed-off-by: José Bollo --- coverage/scripts/run-test.sh | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/coverage/scripts/run-test.sh b/coverage/scripts/run-test.sh index fc45515d..ddf0e09d 100755 --- a/coverage/scripts/run-test.sh +++ b/coverage/scripts/run-test.sh @@ -21,19 +21,36 @@ vg() { fi } -mk() { +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 @@ -70,9 +87,9 @@ 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 @@ -89,7 +106,7 @@ mk $R/bin/test-session mk $R/bin/test-wrap-json ########################################################## -# true life test +# true life test: run parts as direct client ########################################################## mk \ vg \ @@ -144,7 +161,7 @@ $R/bin/afb-daemon-cov \ --exec $R/scripts/run-parts.sh @p @t ########################################################## -# true life test +# true life test: run parts as in-direct client ########################################################## mk \ vg \ @@ -171,7 +188,7 @@ $R/bin/afb-daemon-cov \ --ws-server unix:$R/apis/ws/salut \ --ws-server localhost:9595/salut \ --exec \ - afb-daemon \ + $R/bin/afb-daemon-nocov \ --auto-api $R/apis/auto \ --auto-api $R/apis/ws \ --ws-client localhost:@p/salut2 \ -- cgit 1.2.3-korg