core: When running tests sequentially, print the test name before running it

Useful for debugging hanging tests
This commit is contained in:
Brian Anderson 2012-02-18 16:30:07 -08:00
parent 23d36be1e9
commit 010f2abc70
1 changed files with 11 additions and 2 deletions

View File

@ -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;