summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorGerard Roche <gerardroche@users.noreply.github.com>2020-05-20 16:45:14 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-05-22 09:37:46 +0200
commit2ef88f517d218ef0f9324622f06209c59138a634 (patch)
tree14e86814beec3f112277a2784b53236ca62841f6 /run-tests.php
parent7f51f435097df83af3d39bd088cb17f15ae970a0 (diff)
downloadphp-git-2ef88f517d218ef0f9324622f06209c59138a634.tar.gz
run-tests: echo message and exit if no tests found
The test runner currently defaults to running the entire test suite if no selected tests can be found. This can be unexpected. For example the ext/mysqlnd/ directory has no tests, if you specify that directory when testing the entire test suite will be run. run-tests.php [options] ext/mysqlnd/ Closes GH-5605.
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/run-tests.php b/run-tests.php
index d14fcafeee..51a82aad64 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -394,6 +394,7 @@ NO_PROC_OPEN_ERROR;
$temp_urlbase = null;
$conf_passed = null;
$no_clean = false;
+ $selected_tests = false;
$slow_min_ms = INF;
$preload = false;
$file_cache = null;
@@ -634,6 +635,7 @@ NO_PROC_OPEN_ERROR;
}
if (!$is_switch) {
+ $selected_tests = true;
$testfile = realpath($argv[$i]);
if (!$testfile && strpos($argv[$i], '*') !== false && function_exists('glob')) {
@@ -664,6 +666,11 @@ NO_PROC_OPEN_ERROR;
}
}
+ if ($selected_tests && count($test_files) === 0) {
+ echo "No tests found.\n";
+ return;
+ }
+
// Default to PHP_BINARY as executable
if (!isset($environment['TEST_PHP_EXECUTABLE'])) {
$php = PHP_BINARY;