Skip to content

ensure-stubs-compile: continue early if allowed not to compile #496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions _test/ensure-stubs-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down