summaryrefslogtreecommitdiffstats
path: root/afm-test.native.sh
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-05 20:13:17 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-10 10:53:48 +0200
commit9ec26c035bec8b96384586bf620be606d0585af5 (patch)
treee9f807a6093bafd264032dadc48d8904ec61b03c /afm-test.native.sh
parent5cbc23886bfa33fdd77a9b95fc1dbedfeab06310 (diff)
Improve exit output message
Display the tests results depending on the chosen format or inform the user of the error and displaying in that case the binder(s) log output. Change-Id: Id1d91d55b182969e8a5a8d7aed319d16aec0db19 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'afm-test.native.sh')
-rw-r--r--afm-test.native.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/afm-test.native.sh b/afm-test.native.sh
index 367319e..295102c 100644
--- a/afm-test.native.sh
+++ b/afm-test.native.sh
@@ -20,10 +20,20 @@
trap "cleanNexit 1" SIGHUP SIGINT SIGABRT SIGTERM
cleanNexit() {
- rm -f $SOCKETSERVICE 2> /dev/null
- trap '' EXIT SIGHUP SIGINT SIGABRT SIGTERM
- [ $1 -ne 0 ] && echo "Error: Test launch failed. Code: $1" && cat ${LOGFILETEST} ${LOGFILESERVICE}
- exit $1
+ rm -f $SOCKETSERVICE 2> /dev/null
+ trap '' EXIT SIGHUP SIGINT SIGABRT SIGTERM
+ if [ $1 -ne 0 ]
+ then
+ [ -f ${LOGFILESERVICE} ] && cat ${LOGFILESERVICE}
+ [ -f ${LOGFILETEST} ] && cat ${LOGFILETEST}
+ echo "Error: Test launch failed. Code: $1"
+ else
+ find ${TESTPACKAGEDIR} -maxdepth 1 -name '*.tap' -exec cat {} \;
+ find ${TESTPACKAGEDIR} -maxdepth 1 -name '*.txt' -exec cat {} \;
+ find ${TESTPACKAGEDIR} -maxdepth 1 -name '*.xml' -a ! -name 'config.xml' -exec cat {} \;
+ echo "Tests correctly launched."
+ fi
+ exit $1
}
function usage() {