Skip to content

Allow processing of SKIPIF output after a nocache tag #8076

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

Open
wants to merge 2 commits into
base: PHP-8.1
Choose a base branch
from
Open
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
11 changes: 8 additions & 3 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -3720,9 +3720,14 @@ public function checkSkip(string $php, string $code, string $checkFile, string $

save_text($checkFile, $code, $tempFile);
$result = trim(system_with_timeout("$php \"$checkFile\"", $env));
if (strpos($result, 'nocache') === 0) {
$result = '';
} else if ($this->enable) {
$cacheResult = $this->enable;

while (!strncasecmp('nocache', $result, 7)) {
$result = ltrim(substr($result, 7));
$cacheResult = false;
}

if ($cacheResult) {
Copy link
Member Author

@jmikola jmikola Sep 16, 2022

Choose a reason for hiding this comment

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

I'm slightly concerned about this if we actually target PHP-8.1.

@cmb69: This change should address your previous concern. One or more "nocache" tags will now be consumed exhaustively, which will avoid leaving behind a "nocache" that might otherwise cause the SKIPIF processing in run_test() to BORK.

This also preserves the a ability to "skip a test and disable caching" by emitting "nocache" at the beginning of SKIPIF output, which I mentioned in the PR OP.

$this->skips[$key][$code] = $result;
}
$this->misses++;
Expand Down