1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix run-tests.php to propagate status code on Windows

There is now a workaround in `system_with_timeout()` to avoid issues
with quotes and spaces in the filenames of the executable by using
`start`[1].  However, calling `start` will not propagate the process
status of the actual process.  Thus, calling `proc_get_status()`
is pretty meaningless, and especially Microsoft errors cannot be
detected (typically, access violations etc.), and as such no "Termsig"
message is output.

We fix this by executing `exit` after the started command has finished.

[1] <a6d7d5234b/run-tests.php (L1157-L1162)>

Closes GH-15378.
This commit is contained in:
Christoph M. Becker
2024-08-13 13:35:23 +02:00
parent a51f54b54b
commit 71b908748a

View File

@@ -1177,7 +1177,7 @@ function system_with_timeout(
// and on Windows quotes are discarded, this is a fix to honor the quotes and allow values containing
// spaces like '"C:\Program Files\PHP\php.exe"' to be passed as 1 argument correctly
if (IS_WINDOWS) {
$commandline = 'start "" /b /wait ' . $commandline;
$commandline = 'start "" /b /wait ' . $commandline . ' & exit';
}
$data = '';