From: antirez <antirez@gmail.com>
Date: Mon, 11 Jul 2011 10:56:00 +0000 (+0200)
Subject: better recap of failed tests.
X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/121ffc85f4ab8cb4a961551163ed53541834c2b1

better recap of failed tests.
---

diff --git a/tests/support/test.tcl b/tests/support/test.tcl
index 0fca6182..4e68905a 100644
--- a/tests/support/test.tcl
+++ b/tests/support/test.tcl
@@ -98,9 +98,7 @@ proc test {name code {okpattern undefined}} {
 
     incr ::num_tests
     set details {}
-    lappend details $::curfile
-    lappend details $::tags
-    lappend details $name
+    lappend details "$name in $::curfile"
 
     send_data_packet $::test_server_fd testing $name
 
@@ -111,7 +109,7 @@ proc test {name code {okpattern undefined}} {
             lappend ::tests_failed $details
 
             incr ::num_failed
-            send_data_packet $::test_server_fd err $name
+            send_data_packet $::test_server_fd err [join $details "\n"]
         } else {
             # Re-raise, let handler up the stack take care of this.
             error $error $::errorInfo
@@ -126,7 +124,7 @@ proc test {name code {okpattern undefined}} {
             lappend ::tests_failed $details
 
             incr ::num_failed
-            send_data_packet $::test_server_fd err $name
+            send_data_packet $::test_server_fd err [join $details "\n"]
         }
     }
 
diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl
index 6624ff28..86f88f3f 100644
--- a/tests/test_helper.tcl
+++ b/tests/test_helper.tcl
@@ -277,7 +277,7 @@ proc the_end {} {
         puts "  $time seconds - $name"
     }
     if {[llength $::failed_tests]} {
-        puts "!!! WARNING: The following tests failed\n"
+        puts "\n[colorstr bold-red {!!! WARNING}] The following tests failed:\n"
         foreach failed $::failed_tests {
             puts "*** $failed"
         }
diff --git a/tests/unit/other.tcl b/tests/unit/other.tcl
index dff57715..8eebdc63 100644
--- a/tests/unit/other.tcl
+++ b/tests/unit/other.tcl
@@ -1,4 +1,11 @@
 start_server {tags {"other"}} {
+    if {$::force_failure} {
+        # This is used just for test suite development purposes.
+        test {Failing test} {
+            format err
+        } {ok}
+    }
+
     test {SAVE - make sure there are all the types as values} {
         # Wait for a background saving in progress to terminate
         waitForBgsave r
@@ -242,11 +249,4 @@ start_server {tags {"other"}} {
     test {Perform a final SAVE to leave a clean DB on disk} {
         r save
     } {OK}
-
-    if {$::force_failure} {
-        # This is used just for test suite development purposes.
-        test {Failing test} {
-            format err
-        } {ok}
-    }
 }