Skip to content

Commit e891e0b

Browse files
committed
Print a list of test failures in the test summary. Issue #428
1 parent b9b674a commit e891e0b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib/test.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ fn run_tests(&test_opts opts, &test_desc[] tests) -> bool {
107107
auto failed = 0u;
108108
auto ignored = 0u;
109109

110+
auto failures = ~[];
111+
110112
for (test_desc test in filtered_tests) {
111113
out.write_str(#fmt("running %s ... ", test.name));
112114
alt (run_test(test)) {
@@ -119,6 +121,7 @@ fn run_tests(&test_opts opts, &test_desc[] tests) -> bool {
119121
failed += 1u;
120122
write_failed(out);
121123
out.write_line("");
124+
failures += ~[test];
122125
}
123126
tr_ignored {
124127
ignored += 1u;
@@ -131,6 +134,13 @@ fn run_tests(&test_opts opts, &test_desc[] tests) -> bool {
131134
assert passed + failed + ignored == total;
132135
auto success = failed == 0u;
133136

137+
if (!success) {
138+
out.write_line("\nfailures:");
139+
for (test_desc test in failures) {
140+
out.write_line(#fmt(" %s", test.name));
141+
}
142+
}
143+
134144
out.write_str(#fmt("\nresult: "));
135145
if (success) {
136146
write_ok(out);

0 commit comments

Comments
 (0)