Skip to content

Commit ce8cac5

Browse files
committed
Use color to report the final test result, even when running in parallel
After the tests are run there is no more parallelism, so it should be less likely that the control characters will introduce wierd artifacts.
1 parent a601eb1 commit ce8cac5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ fn run_tests_console_(opts: &test_opts, tests: &test_desc[],
171171

172172
st.out.write_str(#fmt("\nresult: "));
173173
if success {
174-
write_ok(st.out, st.use_color);
175-
} else { write_failed(st.out, st.use_color); }
174+
// There's no parallelism at this point so it's safe to use color
175+
write_ok(st.out, true);
176+
} else { write_failed(st.out, true); }
176177
st.out.write_str(#fmt(". %u passed; %u failed; %u ignored\n\n",
177178
st.passed, st.failed, st.ignored));
178179

0 commit comments

Comments
 (0)