diff --git a/run-tests.php b/run-tests.php index b83bac173ead7f0f72e192780ebb7b221d76d6aa..50237a8ae9939387d679c86972b9c7aca4404f36 100644 --- a/run-tests.php +++ b/run-tests.php @@ -10,6 +10,7 @@ $help_strings = ['-h', '--help', '-v', '--version']; if (!$site_to_test || in_array($site_to_test, $help_strings)) { $script = basename($_SERVER['argv'][0]); echo 'Usage: ' . $script . " URL-TO-TEST [ADDITIONAL-ARGUMENTS ...]\n"; + echo "To test specified classes, use: --class CLASSNAME[,CLASSNAME]\n"; echo "In Drupal 8, pass the argument --suppress-deprecations.\n"; echo "(The argument is not needed for Drupal 9.)\n"; exit(1); @@ -33,11 +34,14 @@ $_SERVER['argv'] = [ '--non-html', '--sqlite', '/tmp/drupal/test.sqlite', - '--module', - implode(',', $modules_to_test), '--url', $site_to_test, ]; +// Allow testing specified classes. Default to running all module tests. +if (!array_search('--class', $original_argv)) { + $_SERVER['argv'][] = '--module'; + $_SERVER['argv'][] = implode(',', $modules_to_test); +} $_SERVER['argv'] = array_merge($_SERVER['argv'], $original_argv); // Run the tests.