forked from lenticularis39/axpbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Windows github action to run test of axpbox rom
- Loading branch information
Remy van Elst
committed
May 1, 2024
1 parent
f3bd6f4
commit 1ea19ae
Showing
2 changed files
with
60 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Download the firmware | ||
Invoke-WebRequest -Uri 'http://raymii.org/s/inc/downloads/es40-srmon/cl67srmrom.exe' -OutFile 'cl67srmrom.exe' | ||
|
||
ls | ||
|
||
ls .. | ||
|
||
ls ../../ | ||
|
||
ls ../../../ | ||
|
||
ls ../../../ | ||
|
||
# Start AXPbox | ||
Start-Process '..\..\..\build\Release\axpbox' -ArgumentList 'run' -NoNewWindow -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt | ||
|
||
# Wait for AXPbox to start | ||
Start-Sleep -Seconds 5 | ||
|
||
|
||
Get-Content stdout.txt | ||
Get-Content stderr.txt | ||
|
||
# Connect to terminal | ||
Start-Process -FilePath 'nc' -ArgumentList '-t', '127.0.0.1', '21000' -NoNewWindow -RedirectStandardOutput 'axp.log' | ||
|
||
# Wait for the last line of log to become P00>>> | ||
$timeout = 600 | ||
while ($true) { | ||
if ($timeout -eq 0) { | ||
Write-Host "waiting for SRM prompt timed out" -ForegroundColor Red | ||
exit 1 | ||
} | ||
|
||
# print last line and remove null byte from it | ||
$lastLine = Get-Content -Path 'axp.log' | Select-Object -Last 1 | ||
if ($lastLine.Replace([char]0, '') -eq "P00>>>") { | ||
break | ||
} | ||
|
||
Start-Sleep -Seconds 1 | ||
$timeout-- | ||
} | ||
|
||
Stop-Process -Name 'nc' | ||
|
||
# Diff logs | ||
Write-Host -NoNewline -ForegroundColor DarkRed "" | ||
Compare-Object -ReferenceObject (Get-Content 'axp_correct.log') -DifferenceObject (Get-Content 'axp.log') | Format-Table | ||
Write-Host -NoNewline -ForegroundColor DarkGreen "diff clean" | ||
$result = $LASTEXITCODE | ||
Write-Host -NoNewline -ForegroundColor White "" | ||
|
||
Remove-Item -Path 'axp.log', 'cl67*', '*.rom' | ||
exit $result |