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 use winpcap and run test of axpbox rom
- Loading branch information
Remy van Elst
committed
May 1, 2024
1 parent
f3bd6f4
commit 3302eb4
Showing
5 changed files
with
114 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# - Try to find WinPcap | ||
# | ||
# Sets the following variables: | ||
# | ||
# WINPCAP_FOUND - if package found | ||
# WINPCAP_INCLUDE_DIRS - include directories | ||
# WINPCAP_LIBRARIES - libraries | ||
# | ||
|
||
find_path(WINPCAP_INCLUDE_DIR NAMES pcap.h | ||
PATH_SUFFIXES | ||
WpdPack/Include | ||
winpcap/WpdPack/Include | ||
) | ||
|
||
find_library(WINPCAP_LIBRARY_PACKET Packet | ||
PATH_SUFFIXES | ||
WpdPack/Lib | ||
winpcap/WpdPack/Lib | ||
) | ||
|
||
find_library(WINPCAP_LIBRARY_WPCAP wpcap | ||
PATH_SUFFIXES | ||
WpdPack/Lib | ||
winpcap/WpdPack/Lib | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(WinPcap DEFAULT_MSG | ||
WINPCAP_INCLUDE_DIR | ||
WINPCAP_LIBRARY_PACKET | ||
WINPCAP_LIBRARY_WPCAP | ||
) | ||
|
||
if(WINPCAP_FOUND) | ||
set(WINPCAP_INCLUDE_DIRS ${WINPCAP_INCLUDE_DIR}) | ||
set(WINPCAP_LIBRARIES ${WINPCAP_LIBRARY_PACKET} ${WINPCAP_LIBRARY_WPCAP}) | ||
else() | ||
set(WINPCAP_INCLUDE_DIRS) | ||
set(WINPCAP_LIBRARIES) | ||
endif() | ||
|
||
mark_as_advanced(WINPCAP_LIBRARIES WINPCAP_INCLUDE_DIRS) |
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,46 @@ | ||
# Download the firmware | ||
Invoke-WebRequest -Uri 'http://raymii.org/s/inc/downloads/es40-srmon/cl67srmrom.exe' -OutFile 'cl67srmrom.exe' | ||
|
||
# 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 | ||
|
||
# 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 | ||
} | ||
|
||
echo "=== start axp.log ===" | ||
Get-Content -Path 'axp.log' -Raw | ||
echo "=== end axp.log ===" | ||
|
||
$content = Get-Content -Path 'axp.log' -Raw | ||
$contentWithoutNullBytes = $content -replace '\0', '' | ||
|
||
if ($contentWithoutNullBytes -match "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 |
Binary file not shown.