The test runner's main returns unit, not int. Issue #428

The appropriate way to indicate failure from main is to fail.
This commit is contained in:
Brian Anderson
2011-07-14 10:51:38 -07:00
parent f4beac4a43
commit 4038010bc6
2 changed files with 4 additions and 6 deletions

View File

@@ -27,11 +27,9 @@ type test_desc = rec(test_name name,
// The default console test runner. It accepts the command line
// arguments and a vector of test_descs (generated at compile time).
fn test_main(&vec[str] args, &test_desc[] tests) -> int {
if (run_tests(parse_opts(args), tests)) {
ret 0;
} else {
ret -1;
fn test_main(&vec[str] args, &test_desc[] tests) {
if (!run_tests(parse_opts(args), tests)) {
fail "Some tests failed";
}
}