diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3412754..ee2ee5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/tests/run-tests.ps1 b/tests/run-tests.ps1 index b0f2f06..80cfe81 100644 --- a/tests/run-tests.ps1 +++ b/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 } }