Skip to content

Commit 26e3f8c

Browse files
committed
Exit non-zero if the tests fail
Signed-off-by: Stefano Rivera <[email protected]>
1 parent 34b26f4 commit 26e3f8c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

t/run_coverage

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -eu
4+
35
orig_dir=$(cd $(dirname $0) && pwd -P)
46
tmpdir=$(mktemp -d)
57

@@ -17,11 +19,17 @@ EOF
1719
export COVERAGE_PROCESS_START=$tmpdir/.coveragerc
1820
export PYTHONPATH=$tmpdir:
1921

22+
# Produce a coverage report, even if the tests fail
23+
set +e
2024
$orig_dir/run_tests
25+
exitcode=$?
26+
set -e
2127

2228
cd $tmpdir
2329
coverage3 combine
2430
coverage3 html -d $orig_dir/report
2531
coverage3 report -m
2632
cd $orig_dir
2733
rm -rf $tmpdir
34+
35+
exit $exitcode

t/run_tests

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -eu
23

34
cd $(dirname $0)
45

@@ -7,4 +8,9 @@ cd $(dirname $0)
78
# for file/directory names when it should always be bytestrings.
89
export PRETEND_UNICODE_ARGS=1
910

10-
ls t939*.sh | xargs -n 1 bash
11+
failed=0
12+
13+
for test in t939*.sh; do
14+
./$test || failed=1
15+
done
16+
exit $failed

0 commit comments

Comments
 (0)