diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 5594dd5..18e134b 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -151,6 +151,11 @@ function simpletest_script_help() { --color Output text format results with color highlighting. + --summary-only + + Do not output detailed assertion messages for exceptions and + failed tests. + --verbose Output detailed assertion messages in addition to summary. --keep-results @@ -209,6 +214,7 @@ function simpletest_script_parse_args() { 'class' => FALSE, 'file' => FALSE, 'color' => FALSE, + 'summary-only' => FALSE, 'verbose' => FALSE, 'keep-results' => FALSE, 'test_names' => array(), @@ -812,12 +818,21 @@ function simpletest_script_reporter_timer_stop() { function simpletest_script_reporter_display_results() { global $args, $test_ids, $results_map; - if ($args['verbose']) { + if (!$args['summary-only'] || $args['verbose']) { // Report results. - echo "Detailed test results\n"; - echo "---------------------\n"; - $results = db_query("SELECT * FROM {simpletest} WHERE test_id IN (:test_ids) ORDER BY test_class, message_id", array(':test_ids' => $test_ids)); + if ($args['verbose']) { + $results = db_query("SELECT * FROM {simpletest} WHERE test_id IN (:test_ids) ORDER BY test_class, message_id", array(':test_ids' => $test_ids)); + echo "Detailed test results\n"; + echo "---------------------\n"; + } + else { + $results = db_query("SELECT * FROM {simpletest} WHERE test_id IN (:test_ids) AND status IN ('fail', 'exception') ORDER BY test_class, message_id", array(':test_ids' => $test_ids)); + if (count($results)) { + echo "Detailed failures and exceptions\n"; + echo "--------------------------------\n"; + } + } $test_class = ''; foreach ($results as $result) { if (isset($results_map[$result->status])) {