? .DS_Store ? fix-run-tests-243773-129.patch ? simpletest-batchapi-243773-103.patch ? simpletest-batchapi-243773-108.patch ? includes/.DS_Store ? modules/.DS_Store ? modules/aggregator/.DS_Store ? modules/simpletest/.DS_Store ? modules/system/.DS_Store ? modules/user/.DS_Store ? profiles/default/.DS_Store ? sites/all/modules ? sites/default/files ? sites/default/settings.php Index: scripts/run-tests.sh =================================================================== RCS file: /cvs/drupal/drupal/scripts/run-tests.sh,v retrieving revision 1.2 diff -u -p -r1.2 run-tests.sh --- scripts/run-tests.sh 24 Jun 2008 21:51:03 -0000 1.2 +++ scripts/run-tests.sh 25 Jun 2008 02:31:50 -0000 @@ -1,4 +1,4 @@ -#!/Applications/MAMP/bin/php5/bin/php +#!/usr/bin/php [,[, ...]] @@ -123,11 +123,24 @@ if ($clean) { } $tests = simpletest_get_all_tests(); +$groups = simpletest_categorize_tests($tests); $test_list = array(); if ($all) { $test_list = $tests; } +elseif ($list) { + // Display all availabe tests. + echo("Available test groups:\n----------------------\n"); + foreach ($groups as $group => $tests) { + echo($group . "\n"); + foreach ($tests as $class => $instance) { + $info = $instance->getInfo(); + echo(" - ". $info['name'] . " (" . $class . ")\n"); + } + } + exit; +} else if ($class_names) { foreach ($test_names as $test) { if (isset($tests[$test])) { @@ -136,7 +149,6 @@ else if ($class_names) { } } else { - $groups = simpletest_categorize_tests($tests); foreach ($test_names as $test) { if (isset($groups[$test])) { $test_list += $groups[$test]; @@ -178,8 +190,18 @@ foreach ($test_list as $class => $instan foreach ($test_results[$class] as $key => $value) { $test_results[$key] += $value; } - echo(t('@name: @summary', array('@name' => $info['name'], '@summary' => _simpletest_format_summary_line($test_results[$class]))) . "\n"); + _run_tests_format($test_results[$class], t('@name: @summary', array('@name' => $info['name'], '@summary' => _simpletest_format_summary_line($test_results[$class])))); } -echo(_simpletest_format_summary_line($test_results) . "\n"); +_run_tests_format($test_results, "\n" . _simpletest_format_summary_line($test_results)); + +function _run_tests_format($test_results, $text) { + if ($test_results['#fail'] > 0 || $test_results['#exception'] > 0) { + $color = "41;37"; + } + else { + $color = "42;37"; + } + echo("\033[" . $color . ";1m" . $text . "\033[0m\n"); +}