Skip to content

Commit

Permalink
test/lua: properly detect failing tests
Browse files Browse the repository at this point in the history
Previously, errors were detected by the exit code of vis with is always 0.
Detect errors by checking if 0 failures/errors/pending are reported in
the report generated by busted.
  • Loading branch information
fischerling committed Sep 10, 2024
1 parent d8276d9 commit dab1f4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/lua/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ for t in $test_files; do
printf "%-30s" "$t"
$VIS "$t.in" < /dev/null 2> /dev/null > "$t.busted"

if [ $? -ne 0 ]; then
printf "FAIL\n"
cat "$t.busted"
else
if grep -F -q '0 failures / 0 errors / 0 pending' "${t}.busted"; then
TESTS_OK=$((TESTS_OK + 1))
printf "OK\n"
else
printf "FAIL\n"
cat "$t.busted"
fi
done

Expand Down

0 comments on commit dab1f4a

Please sign in to comment.