Skip to content

Commit 4f42681

Browse files
committed
check-exercises: Show all failures in DENYWARNINGS mode
This requires not setting -e for the `cargo test` run, nor exiting early in the manual status check. The motivation is that we'd like to see all warnings in this mode, not just the first exercise with warnings.
1 parent 4a616ca commit 4f42681

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

_test/check-exercises.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
#!/bin/bash
22

3-
set -e
3+
# In DENYWARNINGS mode, do not set -e so that we run all tests.
4+
# This allows us to see all warnings.
5+
if [ -z "$DENYWARNINGS" ]; then
6+
set -e
7+
fi
8+
49
tmp=${TMPDIR:-/tmp/}
510
mkdir "${tmp}exercises"
611

12+
exitcode=0
13+
714
# An exercise worth testing is defined here as any top level directory with
815
# a 'tests' directory
916
for exercise in exercises/*/tests; do
@@ -38,7 +45,8 @@ for exercise in exercises/*/tests; do
3845

3946
if [ $status -ne 0 ]
4047
then
41-
echo "Failed";
42-
return 1;
48+
exitcode=1
4349
fi
4450
done
51+
52+
exit $exitcode

0 commit comments

Comments
 (0)