about summary refs log tree commit diff
path: root/src/lib
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-07-21 22:26:53 -0700
committerBrian Anderson <banderson@mozilla.com>2011-07-22 10:18:28 -0700
commite891e0b9924f5c5a4d417b6741d1001bc4f71ec5 (patch)
treed9c0d9e8034f1d79a088fbead3fbb3b0a3d0b839 /src/lib
parentb9b674abe70dd6f666ac3318e26d28c8f61b8e40 (diff)
downloadrust-e891e0b9924f5c5a4d417b6741d1001bc4f71ec5.tar.gz
rust-e891e0b9924f5c5a4d417b6741d1001bc4f71ec5.zip
Print a list of test failures in the test summary. Issue #428
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/test.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/test.rs b/src/lib/test.rs
index d39385cbb5c..678c7ae07d9 100644
--- a/src/lib/test.rs
+++ b/src/lib/test.rs
@@ -107,6 +107,8 @@ fn run_tests(&test_opts opts, &test_desc[] tests) -> bool {
     auto failed = 0u;
     auto ignored = 0u;
 
+    auto failures = ~[];
+
     for (test_desc test in filtered_tests) {
         out.write_str(#fmt("running %s ... ", test.name));
         alt (run_test(test)) {
@@ -119,6 +121,7 @@ fn run_tests(&test_opts opts, &test_desc[] tests) -> bool {
                 failed += 1u;
                 write_failed(out);
                 out.write_line("");
+                failures += ~[test];
             }
             tr_ignored {
                 ignored += 1u;
@@ -131,6 +134,13 @@ fn run_tests(&test_opts opts, &test_desc[] tests) -> bool {
     assert passed + failed + ignored == total;
     auto success = failed == 0u;
 
+    if (!success) {
+        out.write_line("\nfailures:");
+        for (test_desc test in failures) {
+            out.write_line(#fmt("    %s", test.name));
+        }
+    }
+
     out.write_str(#fmt("\nresult: "));
     if (success) {
         write_ok(out);