compiletest: switch crash detection logic for run_crash_test around
previously we would explicitly look for exit code 101 and call it a crash, however in case of stack overflows for example, exit code could differ due to the process being killed by a signal which is not easy to detect on none-unix. So now we reject everything that exits with 0 (no error) or 1 (compiler failed to compile code) and "accept" everyhing else as an internal compiler error.
This commit is contained in:
parent
dd1e35f9c0
commit
a5932b1507
1 changed files with 6 additions and 5 deletions
|
@ -354,7 +354,7 @@ impl<'test> TestCx<'test> {
|
||||||
if self.props.should_ice {
|
if self.props.should_ice {
|
||||||
match proc_res.status.code() {
|
match proc_res.status.code() {
|
||||||
Some(101) => (),
|
Some(101) => (),
|
||||||
_ => self.fatal("test no longer crashes/triggers ICE! Please annotate it and add it as test to tests/ui or wherever you see fit"),
|
_ => self.fatal("expected ICE"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,10 +366,11 @@ impl<'test> TestCx<'test> {
|
||||||
let proc_res = self.compile_test(WillExecute::No, self.should_emit_metadata(pm));
|
let proc_res = self.compile_test(WillExecute::No, self.should_emit_metadata(pm));
|
||||||
|
|
||||||
// if a test does not crash, consider it an error
|
// if a test does not crash, consider it an error
|
||||||
match proc_res.status.code() {
|
if !proc_res.status.success() {
|
||||||
Some(101) => (),
|
match proc_res.status.code() {
|
||||||
Some(other) => self.fatal(&format!("expected exit code 101, got: {}", other)),
|
Some(1 | 0) => self.fatal(&format!("test no longer crashes/triggers ICE! Please annotate it and add it as test to tests/ui or wherever you see fit")),
|
||||||
e => self.fatal(&format!("expected ICE, got '{:?}'", e)),
|
_ => (),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue