add dont_check_failure_status
option in the compiler test
This commit is contained in:
parent
c1d3610ac1
commit
ded048398f
@ -150,6 +150,8 @@ pub struct TestProps {
|
||||
pub normalize_stdout: Vec<(String, String)>,
|
||||
pub normalize_stderr: Vec<(String, String)>,
|
||||
pub failure_status: i32,
|
||||
// For UI tests, allows compiler to exit with arbitrary failure status
|
||||
pub dont_check_failure_status: bool,
|
||||
// Whether or not `rustfix` should apply the `CodeSuggestion`s of this test and compile the
|
||||
// resulting Rust code.
|
||||
pub run_rustfix: bool,
|
||||
@ -192,6 +194,7 @@ mod directives {
|
||||
pub const CHECK_TEST_LINE_NUMBERS_MATCH: &'static str = "check-test-line-numbers-match";
|
||||
pub const IGNORE_PASS: &'static str = "ignore-pass";
|
||||
pub const FAILURE_STATUS: &'static str = "failure-status";
|
||||
pub const DONT_CHECK_FAILURE_STATUS: &'static str = "dont-check-failure-status";
|
||||
pub const RUN_RUSTFIX: &'static str = "run-rustfix";
|
||||
pub const RUSTFIX_ONLY_MACHINE_APPLICABLE: &'static str = "rustfix-only-machine-applicable";
|
||||
pub const ASSEMBLY_OUTPUT: &'static str = "assembly-output";
|
||||
@ -239,6 +242,7 @@ impl TestProps {
|
||||
normalize_stdout: vec![],
|
||||
normalize_stderr: vec![],
|
||||
failure_status: -1,
|
||||
dont_check_failure_status: false,
|
||||
run_rustfix: false,
|
||||
rustfix_only_machine_applicable: false,
|
||||
assembly_output: None,
|
||||
@ -401,6 +405,12 @@ impl TestProps {
|
||||
self.failure_status = code;
|
||||
}
|
||||
|
||||
config.set_name_directive(
|
||||
ln,
|
||||
DONT_CHECK_FAILURE_STATUS,
|
||||
&mut self.dont_check_failure_status,
|
||||
);
|
||||
|
||||
config.set_name_directive(ln, RUN_RUSTFIX, &mut self.run_rustfix);
|
||||
config.set_name_directive(
|
||||
ln,
|
||||
|
@ -309,7 +309,9 @@ impl<'test> TestCx<'test> {
|
||||
);
|
||||
}
|
||||
|
||||
self.check_correct_failure_status(proc_res);
|
||||
if !self.props.dont_check_failure_status {
|
||||
self.check_correct_failure_status(proc_res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// build-fail
|
||||
// known-bug: #95134
|
||||
// compile-flags: -Copt-level=0
|
||||
// failure-status: 101
|
||||
// dont-check-failure-status
|
||||
// dont-check-compiler-stderr
|
||||
|
||||
pub fn encode_num<Writer: ExampleWriter>(n: u32, mut writer: Writer) -> Result<(), Writer::Error> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user