about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-02-18 16:30:07 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-18 16:30:09 -0800
commit010f2abc7029fadff32e3816ad8fb72dd8bf74b4 (patch)
tree6d00c66e49cd20957fd32244211d47d6fb23d89c /src/libstd
parent23d36be1e92e1db1c93086e909483d5aef89a8d8 (diff)
downloadrust-010f2abc7029fadff32e3816ad8fb72dd8bf74b4.tar.gz
rust-010f2abc7029fadff32e3816ad8fb72dd8bf74b4.zip
core: When running tests sequentially, print the test name before running it
Useful for debugging hanging tests
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/test.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libstd/test.rs b/src/libstd/test.rs
index 5fd4d59f74d..003949a9180 100644
--- a/src/libstd/test.rs
+++ b/src/libstd/test.rs
@@ -214,13 +214,22 @@ fn run_tests(opts: test_opts, tests: [test_desc],
 
     while done_idx < total {
         while wait_idx < concurrency && run_idx < total {
-            run_test(vec::shift(filtered_tests), ch);
+            let test = vec::shift(filtered_tests);
+            if concurrency == 1u {
+                // We are doing one test at a time so we can print the name
+                // of the test before we run it. Useful for debugging tests
+                // that hang forever.
+                callback(te_wait(test));
+            }
+            run_test(test, ch);
             wait_idx += 1u;
             run_idx += 1u;
         }
 
         let (test, result) = comm::recv(p);
-        callback(te_wait(test));
+        if concurrency != 1u {
+            callback(te_wait(test));
+        }
         callback(te_result(test, result));
         wait_idx -= 1u;
         done_idx += 1u;