From 9026290640afe0d54702137c17c5c5319496b027 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Sat, 23 Jan 2021 20:09:36 -0500 Subject: [PATCH] Don't test hidden files that happen to end in .phpt This is a tiny improvement to run-tests.php which helps keep it from tripping over hidden files, including autosave files from various editors, metadata on certain platforms, etc. --- run-tests.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run-tests.php b/run-tests.php index baf3ddb91cbe6..36ed068d0eac9 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1091,7 +1091,9 @@ function find_files(string $dir, bool $is_ext_dir = false, bool $ignore = false) } // Otherwise we're only interested in *.phpt files. - if (substr($name, -5) == '.phpt') { + // (but not those starting with a dot, which are hidden on + // many platforms) + if (substr($name, -5) == '.phpt' && substr($name, 0, 1) !== '.') { if ($ignore) { $ignored_by_ext++; } else {