Commit d952784d authored by Dries's avatar Dries

- Patch #254166 by boombatower and pwlonin: added --list feature to list all...

- Patch #254166 by boombatower and pwlonin: added --list feature to list all available test groups and fixed some indentation issues.
parent 493a9ac6
...@@ -27,20 +27,22 @@ ...@@ -27,20 +27,22 @@
All arguments are long options. All arguments are long options.
--help Print this page. --help Print this page.
--list Display all available test groups.
--clean Cleans up database tables or directories from previous, failed, --clean Cleans up database tables or directories from previous, failed,
tests and then exits (no tests are run). tests and then exits (no tests are run).
--url Immediately preceeds a URL to set the host and path. You will --url Immediately preceeds a URL to set the host and path. You will
need this parameter if Drupal is in a subdirectory on your need this parameter if Drupal is in a subdirectory on your
localhost and you have not set \$base_url in settings.php. localhost and you have not set \$base_url in settings.php.
--reporter Immediatly preceeds the name of the output reporter to use. This --reporter Immediatly preceeds the name of the output reporter to use. This
Defaults to "text", while other options include "xml" and "html". Defaults to "text", while other options include "xml" and "html".
--all Run all available tests. --all Run all available tests.
--class Run tests identified by speficic class names. --class Run tests identified by speficic class names.
<test1>[,<test2>[,<test3> ...]] <test1>[,<test2>[,<test3> ...]]
...@@ -52,7 +54,7 @@ ...@@ -52,7 +54,7 @@
specific test classes whose test methods will be run. Tests must specific test classes whose test methods will be run. Tests must
be separated by commas. Ignored if --all is specified. be separated by commas. Ignored if --all is specified.
To run this script you will normally invoke it from the root directory of your To run this script you will normally invoke it from the root directory of your
Drupal installation as Drupal installation as
php ./scripts/{$script} php ./scripts/{$script}
...@@ -61,6 +63,7 @@ ...@@ -61,6 +63,7 @@
exit; exit;
} }
$list = FALSE;
$clean = FALSE; $clean = FALSE;
$all = FALSE; $all = FALSE;
$class_names = FALSE; $class_names = FALSE;
...@@ -68,6 +71,9 @@ ...@@ -68,6 +71,9 @@
while ($param = array_shift($_SERVER['argv'])) { while ($param = array_shift($_SERVER['argv'])) {
switch ($param) { switch ($param) {
case '--list':
$list = TRUE;
break;
case '--url': case '--url':
$url = array_shift($_SERVER['argv']); $url = array_shift($_SERVER['argv']);
$parsed = parse_url($url); $parsed = parse_url($url);
...@@ -133,6 +139,15 @@ ...@@ -133,6 +139,15 @@
$test_instances = $total_test->getTestInstances(); $test_instances = $total_test->getTestInstances();
if ($list) {
// Display all availabe tests.
echo("Available test groups:\n----------------------\n");
foreach ($test_instances as $group_test) {
echo($group_test->getLabel() . "\n");
}
exit;
}
if ($all) { if ($all) {
$test_list = NULL; $test_list = NULL;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment