Skip to content

Commit c42401e

Browse files
committed
Check for the correct exit code on cfail tests. Closes rust-lang#938
1 parent b1bf9ef commit c42401e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/test/compiletest/runtest.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fn run_cfail_test(cx: cx, props: test_props, testfile: str) {
4141
fatal_procres("compile-fail test compiled successfully!", procres);
4242
}
4343

44+
check_correct_failure_status(procres);
4445
check_error_patterns(props, testfile, procres);
4546
}
4647

@@ -57,16 +58,19 @@ fn run_rfail_test(cx: cx, props: test_props, testfile: str) {
5758
fatal_procres("run-fail test isn't valgrind-clean!", procres);
5859
}
5960

61+
check_correct_failure_status(procres);
62+
check_error_patterns(props, testfile, procres);
63+
}
64+
65+
fn check_correct_failure_status(procres: procres) {
6066
// The value the rust runtime returns on failure
6167
const rust_err: int = 101;
6268
if procres.status != rust_err {
6369
fatal_procres(
64-
#fmt("run-fail test produced the wrong error code: %d",
70+
#fmt("failure produced the wrong error code: %d",
6571
procres.status),
6672
procres);
6773
}
68-
69-
check_error_patterns(props, testfile, procres);
7074
}
7175

7276
fn run_rpass_test(cx: cx, props: test_props, testfile: str) {

0 commit comments

Comments
 (0)