File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,15 @@ for dir in $repo/exercises/*/; do
17
17
continue
18
18
fi
19
19
20
- # In Travis CI, we may have already compiled using the example solution.
21
- # Touch the src/lib.rs file so that we surely recompile using the stub.
22
- touch $dir /src/lib.rs
23
-
24
- # Backup tests; this script will modify them.
20
+ # Backup tests and stub; this script will modify them.
25
21
cp -r $dir /tests $dir /tests.orig
22
+ cp $dir /src/lib.rs $dir /lib.rs.orig
23
+
24
+ # This sed serves two purposes:
25
+ # First, in Travis CI, we may have already compiled using the example solution.
26
+ # Edit the src/lib.rs file so that we surely recompile using the stub.
27
+ # Second, ensures that the stub compiles without warnings.
28
+ sed -i -e ' 1i #![deny(warnings)]' " $dir /src/lib.rs"
26
29
27
30
# Deny warnings in the tests that may result from compiling the stubs.
28
31
# This helps avoid, for example, an overflowing literal warning
@@ -34,7 +37,8 @@ for dir in $repo/exercises/*/; do
34
37
broken=" $broken \n$exercise "
35
38
fi
36
39
37
- # Restore tests.
40
+ # Restore tests and stub.
41
+ mv $dir /lib.rs.orig $dir /src/lib.rs
38
42
rm -r $dir /tests
39
43
mv $dir /tests.orig $dir /tests
40
44
fi
You can’t perform that action at this time.
0 commit comments