summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-03-18 08:08:37 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2013-03-18 08:08:37 +0100
commit8c1dd12cb53ce141d8ade2c8abc619dcfa7f37a1 (patch)
treee4a9c66ca728730283d43853870b865ffc7188f8 /test
parentd4ddc5b94d6abbd33a3001d27ff5d9698be3f820 (diff)
downloadapt-8c1dd12cb53ce141d8ade2c8abc619dcfa7f37a1.tar.gz
* test/integration/framework:
- continue after test failure but preserve exit status
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 1c4872c8e..883b65bba 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -1,5 +1,7 @@
#!/bin/sh -- # no runable script, just for vi
+TESTFAILURES="no"
+
# we all like colorful messages
if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null && \
expr match "$(readlink -f /proc/$$/fd/2)" '/dev/pts/[0-9]\+' > /dev/null; then
@@ -36,7 +38,7 @@ msgtest() {
}
msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; }
msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; }
-msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; }
+msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; TESTFAILURES="yes"; }
# enable / disable Debugging
MSGLEVEL=${MSGLEVEL:-3}
@@ -113,9 +115,13 @@ gdb() {
APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1
}
+exitwithstatus() {
+ [ "$TESTFAILURES" = "yes" ] && exit 1 || exit 0;
+}
+
addtrap() {
CURRENTTRAP="$CURRENTTRAP $1"
- trap "$CURRENTTRAP exit;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
+ trap "$CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
}
setupenvironment() {