Exit non-zero if the tests fail

Signed-off-by: Stefano Rivera <stefano@rivera.za.net>
This commit is contained in:
Stefano Rivera 2021-02-16 12:34:58 -08:00
parent 34b26f4026
commit 26e3f8c52e
2 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
set -eu
orig_dir=$(cd $(dirname $0) && pwd -P)
tmpdir=$(mktemp -d)
@ -17,7 +19,11 @@ EOF
export COVERAGE_PROCESS_START=$tmpdir/.coveragerc
export PYTHONPATH=$tmpdir:
# Produce a coverage report, even if the tests fail
set +e
$orig_dir/run_tests
exitcode=$?
set -e
cd $tmpdir
coverage3 combine
@ -25,3 +31,5 @@ coverage3 html -d $orig_dir/report
coverage3 report -m
cd $orig_dir
rm -rf $tmpdir
exit $exitcode

View File

@ -1,4 +1,5 @@
#!/bin/bash
set -eu
cd $(dirname $0)
@ -7,4 +8,9 @@ cd $(dirname $0)
# for file/directory names when it should always be bytestrings.
export PRETEND_UNICODE_ARGS=1
ls t939*.sh | xargs -n 1 bash
failed=0
for test in t939*.sh; do
./$test || failed=1
done
exit $failed