Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions Zend/tests/bug74093.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_lo
--FLAKY--
--SKIPIF--
<?php
if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (PHP_ZTS) die("skip only for no-zts build");
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip not for Windows");
skipif(!getenv('RUN_RESOURCE_HEAVY_TESTS'), 'resource-heavy test');
skipif(getenv('SKIP_SLOW_TESTS'), 'slow test');
skipif(PHP_ZTS, 'only for no-zts build');
skipif(PHP_OS_FAMILY === 'Windows', 'not for Windows');
?>
--INI--
memory_limit=1G
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/new_oom.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Test OOM on new of each class
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0") die("skip requires zmm");
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
skipif(getenv('USE_ZEND_ALLOC') === '0', 'requires zmm');
skipif(getenv('SKIP_SLOW_TESTS'), 'slow test');
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/file/windows_acls/bug44859.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bug #44859 (incorrect result with NTFS ACL permissions, is_writable)
--SKIPIF--
<?php
include_once __DIR__ . '/common.inc';
skipif();
skip_unless_acl_testable();
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/file/windows_acls/bug44859_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bug #44859 (incorrect result with NTFS ACL permissions, is_readable)
--SKIPIF--
<?php
include_once __DIR__ . '/common.inc';
skipif();
skip_unless_acl_testable();
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/file/windows_acls/bug44859_3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bug #44859 (incorrect result with NTFS ACL permissions, is_executable)
--SKIPIF--
<?php
include_once __DIR__ . '/common.inc';
skipif();
skip_unless_acl_testable();
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/file/windows_acls/bug44859_4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Venkat Raman Don
--SKIPIF--
<?php
include_once __DIR__ . '/common.inc';
skipif();
skip_unless_acl_testable();
?>
--FILE--
<?php
Expand Down
17 changes: 5 additions & 12 deletions ext/standard/tests/file/windows_acls/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@ define('PHPT_ACL_FULL', 1 << 5);
define('PHPT_ACL_GRANT', 1);
define('PHPT_ACL_DENY', 2);

function skipif() {
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
die('skip windows only test');
}
if(stripos(php_uname(), 'XP') !== FALSE) {
die('skip windows 2003 or newer only test');
}
if (getenv('GITHUB_ACTIONS')) {
// bug44859_4.phpt test fails on the 1st run
// other ACL tests cannot be run twice
die('skip failing on Github Actions');
}
function skip_unless_acl_testable() {
skipif(substr(PHP_OS, 0, 3) != 'WIN', 'windows only test');
skipif(stripos(php_uname(), 'XP') !== FALSE, 'windows 2003 or newer only test');
// bug44859_4.phpt fails on the 1st run; other ACL tests cannot be run twice
skipif(getenv('GITHUB_ACTIONS'), 'failing on Github Actions');
}

function get_username(){
Expand Down
2 changes: 1 addition & 1 deletion ext/xml/tests/bug26614.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: true);
skipif(!xml_uses_expat(), 'test is for Expat');
?>
--FILE--
<?php
Expand Down
4 changes: 2 additions & 2 deletions ext/xml/tests/bug26614_libxml_gte2_11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: false);
if (LIBXML_VERSION < 21100) die('skip libxml2 test variant for version >= 2.11');
skipif(xml_uses_expat(), 'test is for libxml');
skipif(LIBXML_VERSION < 21100, 'libxml2 test variant for version >= 2.11');
?>
--FILE--
<?php
Expand Down
4 changes: 2 additions & 2 deletions ext/xml/tests/bug26614_libxml_pre2_11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: false);
if (LIBXML_VERSION >= 21100) die('skip libxml2 test variant for version < 2.11');
skipif(xml_uses_expat(), 'test is for libxml');
skipif(LIBXML_VERSION >= 21100, 'libxml2 test variant for version < 2.11');
?>
--FILE--
<?php
Expand Down
8 changes: 4 additions & 4 deletions ext/xml/tests/bug81481.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ xml
memory_limit=-1
--SKIPIF--
<?php
if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
skipif(!getenv('RUN_RESOURCE_HEAVY_TESTS'), 'resource-heavy test');
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: false);
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (PHP_INT_SIZE != 8) die("skip 64-bit only");
skipif(xml_uses_expat(), 'test is for libxml');
skipif(getenv('SKIP_SLOW_TESTS'), 'slow test');
skipif(PHP_INT_SIZE != 8, '64-bit only');
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/xml/tests/gh14834.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: false);
skipif(xml_uses_expat(), 'test is for libxml');
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/xml/tests/gh20439_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: false);
skipif(xml_uses_expat(), 'test is for libxml');
?>
--FILE--
<?php
Expand Down
7 changes: 2 additions & 5 deletions ext/xml/tests/libxml_expat_skipif.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php
function skipif(bool $want_expat) {
function xml_uses_expat(): bool {
ob_start();
echo phpinfo(INFO_MODULES);
$output = ob_get_clean();
if ($want_expat !== str_contains($output, 'EXPAT')) {
die('skip test is for ' . ($want_expat ? 'Expat' : 'libxml'));
}
return str_contains(ob_get_clean(), 'EXPAT');
}
2 changes: 1 addition & 1 deletion ext/xml/tests/xml_error_string_basic_expat.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: true);
skipif(!xml_uses_expat(), 'test is for Expat');
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/xml/tests/xml_error_string_basic_libxml.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: false);
skipif(xml_uses_expat(), 'test is for libxml');
?>
--FILE--
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: true);
skipif(!xml_uses_expat(), 'test is for Expat');
?>
--FILE--
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xml
--SKIPIF--
<?php
require __DIR__ . '/libxml_expat_skipif.inc';
skipif(want_expat: false);
skipif(xml_uses_expat(), 'test is for libxml');
?>
--FILE--
<?php
Expand Down
7 changes: 5 additions & 2 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -3866,6 +3866,9 @@ private function mergeSuites(array &$dest, array $source): void

class SkipCache
{
// Kept on one line so SKIPIF line numbers are unchanged.
private const HELPERS = '<?php function skipif($condition, string $reason): void { if ($condition) { echo "skip $reason"; exit; } } ?>';

private bool $enable;
private bool $keepFile;

Expand Down Expand Up @@ -3893,12 +3896,12 @@ public function checkSkip(array $command, string $code, string $checkFile, strin
if (isset($this->skips[$key][$code])) {
$this->hits++;
if ($this->keepFile) {
save_text($checkFile, $code, $tempFile);
save_text($checkFile, self::HELPERS . $code, $tempFile);
}
return $this->skips[$key][$code];
}

save_text($checkFile, $code, $tempFile);
save_text($checkFile, self::HELPERS . $code, $tempFile);
$env['TEST_PHP_EVALUATING_SKIPIF'] = '1';
$command[] = $checkFile;
$result = trim(system_with_timeout($command, $env));
Expand Down
Loading