Skip to content

Commit

Permalink
roc test every file with an expect
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton-4 authored Feb 9, 2024
1 parent 8547b50 commit 01d8630
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions ci/all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,21 @@ for roc_file in $examples_dir*.roc; do
$ROC build $roc_file --linker=legacy
done

$ROC test platform/Url.roc

$ROC test platform/InternalDateTime.roc
# `roc test` every roc file if it contains a test, skip roc_nightly folder
find . -type d -name "roc_nightly" -prune -o -type f -name "*.roc" -print | while read file; do
if grep -qE '^\s*expect(\s+|$)' "$file"; then

# don't exit script if test_command fails
set +e
test_command=$($ROC test "$file")
test_exit_code=$?
set -e

if [[ $test_exit_code -ne 0 && $test_exit_code -ne 2 ]]; then
exit $test_exit_code
fi
fi
done

# test building website
$ROC docs platform/main.roc

0 comments on commit 01d8630

Please sign in to comment.