File tree 2 files changed +29
-5
lines changed
2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 9
9
- stable
10
10
- beta
11
11
- nightly
12
+ env :
13
+ - DENYWARNINGS=
14
+ - DENYWARNINGS=1
12
15
matrix :
13
16
allow_failures :
14
17
- rust : nightly
18
+ - rust : beta
19
+ env : DENYWARNINGS=1
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
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
+
4
9
tmp=${TMPDIR:-/ tmp/ }
5
10
mkdir " ${tmp} exercises"
6
11
12
+ exitcode=0
13
+
7
14
# An exercise worth testing is defined here as any top level directory with
8
15
# a 'tests' directory
9
16
for exercise in exercises/* /tests; do
@@ -26,15 +33,27 @@ for exercise in exercises/*/tests; do
26
33
sed -i ' /\[ignore\]/d' $test
27
34
done
28
35
29
- # Run the test and get the status
30
- cargo test
36
+ if [ -n " $DENYWARNINGS " ]; then
37
+ sed -i -e ' 1i #![deny(warnings)]' src/lib.rs
38
+
39
+ # No-run mode so we see no test output.
40
+ # Quiet mode so we see no compile output
41
+ # (such as "Compiling"/"Downloading").
42
+ # Compiler errors will still be shown though.
43
+ # Both flags are necessary to keep things quiet.
44
+ cargo test --quiet --no-run
45
+ else
46
+ # Run the test and get the status
47
+ cargo test
48
+ fi
31
49
)
32
50
33
51
status=$?
34
52
35
53
if [ $status -ne 0 ]
36
54
then
37
- echo " Failed" ;
38
- return 1;
55
+ exitcode=1
39
56
fi
40
57
done
58
+
59
+ exit $exitcode
You can’t perform that action at this time.
0 commit comments