Skip to content

Commit 71b9087

Browse files
committed
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] <https://github.com/php/php-src/blob/a6d7d5234b05582d3a333c0f2646fdeae44b4728/run-tests.php#L1157-L1162> Closes GH-15378.
1 parent a51f54b commit 71b9087

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

run-tests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ function system_with_timeout(
11771177
// and on Windows quotes are discarded, this is a fix to honor the quotes and allow values containing
11781178
// spaces like '"C:\Program Files\PHP\php.exe"' to be passed as 1 argument correctly
11791179
if (IS_WINDOWS) {
1180-
$commandline = 'start "" /b /wait ' . $commandline;
1180+
$commandline = 'start "" /b /wait ' . $commandline . ' & exit';
11811181
}
11821182

11831183
$data = '';

0 commit comments

Comments
 (0)