Skip to content

Commit

Permalink
Fix run_test_roms
Browse files Browse the repository at this point in the history
This was broken in 342c756 when a flag
was introduced to stop printing serial output by default.

Since the test looks for 'failed' in the output and Blargg's tests write
that text to the serial output, the tests were passing trivially (by not
finding 'failed' in empty output). We pass the flag again to get output.

We also look for 'Passed' in the output and only pass if we find it,
which will prevent similar issues in the future.
  • Loading branch information
jgilchrist committed May 20, 2024
1 parent 465cbff commit 4f44821
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/run_test_roms
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ run_test_rom() {

printf "%-30s" "${FILENAME}"

local OUTPUT=$(./build/gbemu-test "$1" --headless --exit-on-infinite-jr)
echo $OUTPUT | grep 'Failed' &> /dev/null
local OUTPUT=$(./build/gbemu-test "$1" --headless --print-serial-output --exit-on-infinite-jr)
echo $OUTPUT | grep 'Passed' &> /dev/null

if [ $? == 0 ]; then
printf "${RED}Failed${RESET}\n"
return 1
else
printf "${GREEN}Passed${RESET}\n"
return 0
else
printf "${RED}Failed${RESET}\n"
return 1
fi
}

Expand Down

0 comments on commit 4f44821

Please sign in to comment.