Skip to content

Commit

Permalink
Don't allow error annotations in known-bug tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh726 committed Feb 14, 2022
1 parent 5aae654 commit 36cf48b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,16 @@ impl<'test> TestCx<'test> {
self.fatal_proc_rec("process did not return an error status", proc_res);
}

if self.props.known_bug {
if !expected_errors.is_empty() {
self.fatal_proc_rec(
"`known_bug` tests should not have an expected errors",
proc_res,
);
}
return;
}

// On Windows, keep all '\' path separators to match the paths reported in the JSON output
// from the compiler
let os_file_name = self.testpaths.file.display().to_string();
Expand Down Expand Up @@ -1311,13 +1321,7 @@ impl<'test> TestCx<'test> {

None => {
// If the test is a known bug, don't require that the error is annotated
if !self.props.known_bug
&& self.is_unexpected_compiler_message(
actual_error,
expect_help,
expect_note,
)
{
if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) {
self.error(&format!(
"{}:{}: unexpected {}: '{}'",
file_name,
Expand Down

0 comments on commit 36cf48b

Please sign in to comment.