summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorDylan K. Taylor <odigiman@gmail.com>2021-02-23 22:34:51 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2021-02-25 12:01:04 +0100
commita480bf80933e4d6a8c91a5992b4e5d73da625e17 (patch)
tree1e0bd6aa3596df16baee80e95fb183982683d303 /run-tests.php
parent8309c0446411237a1b17d0368e55af921cfb49e8 (diff)
downloadphp-git-a480bf80933e4d6a8c91a5992b4e5d73da625e17.tar.gz
Capture Microsoft-defined HRESULT exit codes exit codes
The lack of such a check leads to false-passes of tests on Windows which expect no output, but produce a segfault or similar issue. I discovered this a while ago due to bad tests in an extension I maintain. Closes GH-6722.
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/run-tests.php b/run-tests.php
index c68982889a..19b7f5cb40 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1273,6 +1273,9 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS
}
if ($stat["exitcode"] > 128 && $stat["exitcode"] < 160) {
$data .= "\nTermsig=" . ($stat["exitcode"] - 128) . "\n";
+ } else if (defined('PHP_WINDOWS_VERSION_MAJOR') && (($stat["exitcode"] >> 28) & 0b1111) === 0b1100) {
+ // https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781
+ $data .= "\nTermsig=" . $stat["exitcode"] . "\n";
}
proc_close($proc);