Skip to content

Commit 3fb3300

Browse files
committed
Test runner should fail if any tests fail. Issue #428
1 parent 2cb3a79 commit 3fb3300

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
@@ -129,17 +129,18 @@ fn run_tests(&test_opts opts, &test_desc[] tests) -> bool {
129129
}
130130

131131
assert passed + failed + ignored == total;
132+
auto success = failed == 0u;
132133

133134
out.write_str(#fmt("\nresult: "));
134-
if (failed == 0u) {
135+
if (success) {
135136
write_ok(out);
136137
} else {
137138
write_failed(out);
138139
}
139140
out.write_str(#fmt(". %u passed; %u failed; %u ignored\n\n",
140141
passed, failed, ignored));
141142

142-
ret true;
143+
ret success;
143144

144145
fn write_ok(&io::writer out) {
145146
write_pretty(out, "ok", term::color_green);

0 commit comments

Comments
 (0)