From 010f2abc7029fadff32e3816ad8fb72dd8bf74b4 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 18 Feb 2012 16:30:07 -0800 Subject: core: When running tests sequentially, print the test name before running it Useful for debugging hanging tests --- src/libstd/test.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/libstd') 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; -- cgit 1.4.1-3-g733a5