mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
CI: bundle MinGW runtime DLLs and print test output on failure
- ci: copy libstdc++-6/libgcc_s_seh-1/libwinpthread-1 next to the built binaries so the tests can load libagent.dll; without them every test failed with a load error on the runner - tests: run-tests.ps1 now prints a failing test's captured output, so a failure is diagnosable even though the test program exits 0
This commit is contained in:
1 parent
9aebf29bb5
commit
08fe3a8815
2 files changed
+24
-2
No files matched your search
@@ -37,11 +37,24 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
shell: msys2 {0}
|
||||
run: cmake --build build
|
||||
run: |
|
||||
cmake --build build
|
||||
|
||||
# Bundle the MinGW runtime DLLs next to the binaries. The integration
|
||||
# tests load libagent.dll through System.load, and its dependencies
|
||||
# (libstdc++/libgcc/libwinpthread) are otherwise only found via PATH.
|
||||
# copy-bin.bat then carries them into tests/resources as well.
|
||||
for dll in libstdc++-6.dll libgcc_s_seh-1.dll libwinpthread-1.dll; do
|
||||
if [ -f "/mingw64/bin/$dll" ]; then
|
||||
cp -f "/mingw64/bin/$dll" build/bin/
|
||||
fi
|
||||
done
|
||||
echo "--- build/bin ---"
|
||||
ls -1 build/bin
|
||||
|
||||
- name: Run integration tests
|
||||
shell: pwsh
|
||||
run: |
|
||||
# libagent.dll links against the MinGW runtime DLLs from this toolchain.
|
||||
# Prepend the toolchain bin as a fallback for the runtime DLLs.
|
||||
$env:PATH = "C:\msys64\mingw64\bin;$env:PATH"
|
||||
./tests/run-tests.ps1
|
||||
@@ -143,6 +143,15 @@ try {
|
||||
Write-Host (" [PASS] {0}" -f $case.Name) -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host (" [FAIL] {0} (expected /{1}/)" -f $case.Name, $case.Expect) -ForegroundColor Red
|
||||
# Show what the test actually printed so failures are diagnosable
|
||||
# (the test programs exit 0 even when a step fails).
|
||||
$lines = @($output -split "`r?`n" | Where-Object { $_.Trim() })
|
||||
foreach ($line in ($lines | Select-Object -First 25)) {
|
||||
Write-Host (" | " + $line.TrimEnd()) -ForegroundColor DarkGray
|
||||
}
|
||||
if ($lines.Count -gt 25) {
|
||||
Write-Host (" | ... ({0} more lines)" -f ($lines.Count - 25)) -ForegroundColor DarkGray
|
||||
}
|
||||
$failed += $case.Name
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user