Commit Graph

3 Commits

Author SHA1 Message Date
cb878ea034 TEST-BATCH-LAUNCH-EXITCODE: read the batch exit code after the child exits
The launch helper started cmd.exe with -PassThru, held $p.Handle and then
called WaitForExit(). For a stub batch that exits at once, ExitCode can be
null, and `exit $p.ExitCode` turned that into 0. A failing folder then read
as a pass. On origin/main the test failed in every run I made, with exit
code 7 reported as 0 in several folders.

The helper now starts with -Wait -PassThru, so ExitCode is read after the
process has exited, and a null code is reported as 999, which no folder
case expects. The parsed production ArgumentList expression and the folder
cases are unchanged; the negative control that drops the quotes still
fails as intended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 17:42:32 +01:00
d70affa9df test_build_batch_launch: match build_runtime.ps1's multi-line Start-Process
#6787 rewrote the launch in build_runtime.ps1 as
`$p = Start-Process -FilePath cmd.exe -ArgumentList ... -PassThru` followed
by -WindowStyle and the log redirects on continued lines. The test's regex
only knew the one-line `Start-Process cmd.exe ... -NoNewWindow -PassThru`
form, so it found no launch line in build_runtime.ps1. Accept both spellings;
the -ArgumentList expression it extracts and runs is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 17:04:33 -05:00
fc3bda5cd7 scripts: start _build.cmd with cmd /s /c ""path"" so & and ^ survive
build_runtime.ps1 and build_llvm_mc.ps1 started the generated batch with
`cmd.exe /c "path"`. cmd.exe drops those quotes when the path holds a
special character such as & or ^, then runs only the part before it, so a
checkout (build_runtime) or -Temp/%TEMP% (build_llvm_mc) in a folder like
`a & b` failed at once with "C:\...\a is not recognized". With /s and a
second pair of quotes, cmd.exe strips only the outer pair.

tests/test_build_batch_launch.py takes each script's launch line as written
and runs it on a stub batch in folders named plain, `a & b`, `a&b`, `x^y`,
`sp (x)` and `東京 & co`: the stub must run and its exit code (0 and 7) must
come back. It also checks that the old form fails there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:53:58 +01:00