From cdbfa7f4f4fffa2a6074390f2f2505290e75bd39 Mon Sep 17 00:00:00 2001 From: benhillis <17727402+benhillis@users.noreply.github.com> Date: Mon, 11 May 2026 10:42:30 -0700 Subject: [PATCH] Propagate te.exe exit code from run-tests.ps1 `te.exe` is invoked as a native command, so its failure should be detected via `0` rather than `!True` (which can be unreliable for native processes under `Set-StrictMode`). Also propagate the actual exit code instead of substituting a hardcoded `1` so callers (CI, wrapper scripts) can distinguish between te.exe failure modes. Also fix the `-Package` parameter doc: the actual default is `.\installer.msix`, not `.\wsl.msix`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tools/test/run-tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test/run-tests.ps1 b/tools/test/run-tests.ps1 index a2377ce43..6208b8cda 100644 --- a/tools/test/run-tests.ps1 +++ b/tools/test/run-tests.ps1 @@ -12,7 +12,7 @@ .PARAMETER TestDataPath Path to test data folder. Defaults to ".\test_data". .PARAMETER Package - Path to the wsl.msix package to install. Defaults to ".\wsl.msix". + Path to the wsl.msix package to install. Defaults to ".\installer.msix". .PARAMETER UnitTestsPath Path to the linux/unit_tests directory to copy and install the unit tests. .PARAMETER PullRequest @@ -103,9 +103,9 @@ if ($AttachDebugger) else { te.exe $teArgList - if (!$?) + if ($LASTEXITCODE -ne 0) { - exit 1 + exit $LASTEXITCODE } }