-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to mgba_rom_test for faster testing (#175)
It's a 0.10 new platform, which is lighter than mgba-sdl, and also allows automatically closing the emulator when the tests end. Helps making both the actions and the user-side docker testing faster
- Loading branch information
1 parent
7c9408e
commit 1f03f27
Showing
8 changed files
with
53 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,5 @@ void start_tests() | |
|
||
end_session(); | ||
|
||
while(1) | ||
vblank(); | ||
} | ||
stop(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
void start_tests(); | ||
|
||
extern void vblank(); | ||
extern void stop(int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
cpufastset: | ||
swi 0xC | ||
bx lr | ||
|
||
stop: | ||
swi 0x3 | ||
bx lr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
$test_rom_file = "bin/m12test.gba" | ||
$log_file = "bin/test.log" | ||
$sleep_time = 300 | ||
$failure_text = "FAIL" | ||
$end_text = "Done!" | ||
$mgba_name = "mgba-rom-test" | ||
|
||
If ($IsWindows) { $mgba_cmd = "bin/$mgba_name.exe" } | ||
ElseIf ($IsLinux -or $IsMacOS) { $mgba_cmd = "bin/$mgba_name" } | ||
|
||
"Building the test ROM..." | ||
.\build.ps1 -t | ||
if ($LASTEXITCODE -ne 0) { exit -1 } | ||
Remove-Item -Path $log_file | ||
|
||
"Starting the emulator... And closing it after $sleep_time seconds if it hasn't finished by then" | ||
& timeout --preserve-status $sleep_time $mgba_cmd -l 16 -C logLevel.gba.bios=0 -C logToStdout=0 -C logToFile=1 -C logFile=$log_file $test_rom_file | ||
if ($LASTEXITCODE -ne 0) { exit -1 } | ||
|
||
$fails = Select-String -Path $log_file -Pattern $failure_text | ||
if ($fails.count -ne 0) { | ||
"Test failures:" | ||
$fails | ||
exit -1 | ||
} | ||
|
||
$end_session = Select-String -Path $log_file -Pattern $end_text | ||
if ($end_session.count -eq 0) { | ||
"The tests did not run to completion!" | ||
exit -1 | ||
} | ||
|
||
"No failures!" | ||
|
||
exit 0 |