Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,15 @@ if ($CC) {
if ("Failed" -eq $r.Result) {
throw "Run failed!"
}

# Every test passed, so say so with the exit code as well.
#
# Invoke-InNewProcess deliberately lets the child's exit code through, and tests assert on
# it (see "Exitcode is set to the number of failed tests..."), so the helper cannot reset it.
# That means whichever test ran last decides what $LASTEXITCODE holds when we get here, and
# CI ends the step with `exit $LASTEXITCODE`. Without this line a child that exited non-zero
# on purpose turns a fully green run red with no failing test to look at.
#
# This sits after both failure paths above, `exit 1` for P tests and the throw for a failed
# run, so it cannot hide a real failure.
$global:LASTEXITCODE = 0