From 3e32be4ab7a1ff73ee23e828dc26ad59159c05d6 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 10 Feb 2022 18:02:32 -0500 Subject: [PATCH 1/2] Allow processing of SKIPIF output after a nocache tag Previously, a nocache tag would result in the entire SKIPIF output being ignored. This allows the remaining SKIPIF output to still be processed by run_test(). --- run-tests.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-tests.php b/run-tests.php index d772c85f9527..a68135616998 100755 --- a/run-tests.php +++ b/run-tests.php @@ -3720,8 +3720,8 @@ 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 = ''; + if (!strncasecmp('nocache', $result, 7)) { + $result = ltrim(substr($result, 7)); } else if ($this->enable) { $this->skips[$key][$code] = $result; } From 3237f95b1969d646cfdfe1e8c3a3021c19143162 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Fri, 16 Sep 2022 16:23:20 -0400 Subject: [PATCH 2/2] Consume leading nocache tags in SKIPIF output This avoids a potential BC break for existing tests that may print "nocache" multiple times. --- run-tests.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/run-tests.php b/run-tests.php index a68135616998..5c1223ad11c8 100755 --- a/run-tests.php +++ b/run-tests.php @@ -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 (!strncasecmp('nocache', $result, 7)) { + $cacheResult = $this->enable; + + while (!strncasecmp('nocache', $result, 7)) { $result = ltrim(substr($result, 7)); - } else if ($this->enable) { + $cacheResult = false; + } + + if ($cacheResult) { $this->skips[$key][$code] = $result; } $this->misses++;