Skip to content

run-tests: capture Windows-specific error exit codes #6722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use IS_WINDOWS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not available prior to 8.0.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's defined above :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctrl+f here: https://github.com/php/php-src/blob/992960e38eca2fd46601a6f286ef1908ca802e84/run-tests.php
This PR targets 7.3, IS_WINDOWS is not defined here. It's only defined in 8.0+'s version of run-tests.php: https://github.com/php/php-src/blob/PHP-8.0/run-tests.php#L155

// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781
$data .= "\nTermsig=" . $stat["exitcode"] . "\n";
}

proc_close($proc);
Expand Down