From ac5a88f0c9807bec1ad17c731f79518287b14dc5 Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Sun, 8 Apr 2018 13:19:46 +0000 Subject: [PATCH] ensure-stubs-compile: continue early if allowed not to compile Strictly speaking this should have been done ever since #483, but it wasn't necessary then because touching a file doesn't impose any costs. But if we were to impose additional work on ensure-stubs-compile, then we would actually want to do this. This commit paves the way for future additions to this script. --- _test/ensure-stubs-compile.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/_test/ensure-stubs-compile.sh b/_test/ensure-stubs-compile.sh index 10d8bda63..d053acc56 100644 --- a/_test/ensure-stubs-compile.sh +++ b/_test/ensure-stubs-compile.sh @@ -12,13 +12,16 @@ for dir in $repo/exercises/*/; do if grep -v '^//' $dir/src/lib.rs | grep '\S' > /dev/null; then allowed_file=$dir/.meta/ALLOWED_TO_NOT_COMPILE + if [ -f $allowed_file ]; then + echo "$exercise's stub is allowed to not compile" + continue + fi + # In Travis CI, we may have already compiled using the example solution. # Touch the src/lib.rs file so that we surely recompile using the stub. touch $dir/src/lib.rs - if [ -f $allowed_file ]; then - echo "$exercise's stub is allowed to not compile" - elif ! (cd $dir && cargo test --quiet --no-run); then + if ! (cd $dir && cargo test --quiet --no-run); then echo "$exercise's stub does not compile; please make it compile or remove all non-commented lines" broken="$broken\n$exercise" fi