]> git.notmuchmail.org Git - notmuch/blobdiff - test/notmuch-test
test: report summary even when aborting
[notmuch] / test / notmuch-test
index 50ed87219f3cb0793208aca2c3eed3e1199c5ce0..b58fd3b36f942a91fbe0ac9708d53aef9fdf4e1e 100755 (executable)
@@ -45,6 +45,8 @@ else
 fi
 
 trap 'e=$?; kill $!; exit $e' HUP INT TERM
 fi
 
 trap 'e=$?; kill $!; exit $e' HUP INT TERM
+
+META_FAILURE=
 # Run the tests
 if test -z "$NOTMUCH_TEST_SERIALIZE" && command -v parallel >/dev/null ; then
     test -t 1 && export COLORS_WITHOUT_TTY=t || :
 # Run the tests
 if test -z "$NOTMUCH_TEST_SERIALIZE" && command -v parallel >/dev/null ; then
     test -t 1 && export COLORS_WITHOUT_TTY=t || :
@@ -57,8 +59,7 @@ if test -z "$NOTMUCH_TEST_SERIALIZE" && command -v parallel >/dev/null ; then
     fi
     RES=$?
     if [[ $RES != 0 ]]; then
     fi
     RES=$?
     if [[ $RES != 0 ]]; then
-        echo "parallel test suite returned error code $RES"
-        exit $RES
+        META_FAILURE="parallel test suite returned error code $RES"
     fi
 else
     for test in $TESTS; do
     fi
 else
     for test in $TESTS; do
@@ -69,7 +70,8 @@ else
         RES=$?
         testname=$(basename $test .sh)
         if [[ $RES != 0 && ! -e "$NOTMUCH_BUILDDIR/test/test-results/$testname" ]]; then
         RES=$?
         testname=$(basename $test .sh)
         if [[ $RES != 0 && ! -e "$NOTMUCH_BUILDDIR/test/test-results/$testname" ]]; then
-            exit $RES
+            META_FAILURE="Aborting on $testname (returned $RES)"
+            break
         fi
     done
 fi
         fi
     done
 fi
@@ -79,6 +81,12 @@ trap - HUP INT TERM
 echo
 $NOTMUCH_SRCDIR/test/aggregate-results.sh $NOTMUCH_BUILDDIR/test/test-results/*
 ev=$?
 echo
 $NOTMUCH_SRCDIR/test/aggregate-results.sh $NOTMUCH_BUILDDIR/test/test-results/*
 ev=$?
+if [ -n "$META_FAILURE" ]; then
+    printf 'ERROR: %s\n' "$META_FAILURE"
+    if [ $ev = 0 ]; then
+        ev=$RES
+    fi
+fi
 
 # Clean up
 rm -rf $NOTMUCH_BUILDDIR/test/test-results
 
 # Clean up
 rm -rf $NOTMUCH_BUILDDIR/test/test-results