From 86bf07723868a72e3339d54462981c3bdc45dbb8 Mon Sep 17 00:00:00 2001 From: Liam Morland <lkmorlan@uwaterloo.ca> Date: Mon, 8 Feb 2021 16:29:36 -0500 Subject: [PATCH] ISTWCMS-4591: Allow testing specified classes in run-tests.php --- run-tests.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/run-tests.php b/run-tests.php index b83bac173..50237a8ae 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. -- GitLab