Skip to content

Commit

Permalink
run scarb build to check lib.cairo during verify-exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi committed Nov 12, 2024
1 parent 60095d9 commit 7c2844f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions bin/verify-exercises
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,21 @@ for exercise_path in $exercises; do
cp -r "$exercise_path/$c" "$tmp_dir"
done

cd "$tmp_dir"

scarb build

# Move example files to where Cargo expects them
if [ -f "$exercise_path/.meta/example.cairo" ]; then
cp -f "$exercise_path/.meta/example.cairo" "$tmp_dir/src/lib.cairo"
elif [ -f "$exercise_path/.meta/exemplar.cairo" ]; then
cp -f "$exercise_path/.meta/exemplar.cairo" "$tmp_dir/src/lib.cairo"
if [ -f "$repo/$exercise_path/.meta/example.cairo" ]; then
cp -f "$repo/$exercise_path/.meta/example.cairo" "$tmp_dir/src/lib.cairo"
elif [ -f "$repo/$exercise_path/.meta/exemplar.cairo" ]; then
cp -f "$repo/$exercise_path/.meta/exemplar.cairo" "$tmp_dir/src/lib.cairo"
else
echo "Could not locate example implementation for $exercise_path"
exit 1
fi

cd "$tmp_dir"

# Exercism sets a timeout limit for tests
timeout 20 scarb cairo-test --include-ignored || (echo "$exercise timed out" && exit 1)

rm -rf "$tmp_dir"
Expand Down

0 comments on commit 7c2844f

Please sign in to comment.