From ce097a7b54ff0be93cb812c759bfc620fc0ee7c9 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sun, 15 Apr 2012 00:07:15 +1200 Subject: [PATCH] ENHANCEMENT If there are no test failures, but incomplete tests, mark summary of test run as "ok but incomplete" in yellow for CliTestReporter --- dev/CliTestReporter.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dev/CliTestReporter.php b/dev/CliTestReporter.php index 5870f3c14..52aa4b0d5 100644 --- a/dev/CliTestReporter.php +++ b/dev/CliTestReporter.php @@ -31,10 +31,12 @@ class CliTestReporter extends SapphireTestReporter { } echo "\n\n"; - if ($failCount == 0) { - echo SS_Cli::text(" ALL TESTS PASS ", "white", "green"); + if ($failCount == 0 && $incompleteCount > 0) { + echo SS_Cli::text(" OK, BUT INCOMPLETE TESTS! ", "black", "yellow"); + } elseif ($failCount == 0) { + echo SS_Cli::text(" ALL TESTS PASS ", "black", "green"); } else { - echo SS_Cli::text(" AT LEAST ONE FAILURE ", "white", "red"); + echo SS_Cli::text(" AT LEAST ONE FAILURE ", "black", "red"); } echo sprintf("\n\n%d tests run: %s, %s, and %s\n", $testCount, SS_Cli::text("$passCount passes"), SS_Cli::text("$failCount failures"), SS_Cli::text("$incompleteCount incomplete")); @@ -97,12 +99,12 @@ class CliTestReporter extends SapphireTestReporter { } if( $test['status'] == 2) { - echo "\n" . SS_Cli::text($this->testNameToPhrase($test['name']) . "\n" . $test['message'] . "\n", 'yellow', null, true); + echo "\n" . SS_Cli::text($test['name'] . "\n" . $test['message'] . "\n", 'yellow', null); } else { - echo "\n" . SS_Cli::text($this->testNameToPhrase($test['name']) . "\n". $test['message'] . "\n", 'red', null, true); + echo "\n" . SS_Cli::text($test['name'] . "\n". $test['message'] . "\n", 'red', null); echo SS_Backtrace::get_rendered_backtrace($filteredTrace, true); } - echo "\n--------------------\n"; + echo "--------------------\n"; } }