Skip to content

compiletest: Support forbid-output in UI tests #134738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/tools/compiletest/src/runtest/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,13 @@ impl TestCx<'_> {
self.fatal_proc_rec("test run succeeded!", &proc_res);
}

let output_to_check = self.get_output(&proc_res);
if !self.props.error_patterns.is_empty() || !self.props.regex_error_patterns.is_empty()
{
// "// error-pattern" comments
let output_to_check = self.get_output(&proc_res);
self.check_all_error_patterns(&output_to_check, &proc_res, pm);
}
self.check_forbid_output(&output_to_check, &proc_res)
}

debug!(
Expand Down Expand Up @@ -181,11 +182,12 @@ impl TestCx<'_> {
);
self.fatal(&msg);
}
let output_to_check = self.get_output(&proc_res);
if check_patterns {
// "// error-pattern" comments
let output_to_check = self.get_output(&proc_res);
self.check_all_error_patterns(&output_to_check, &proc_res, pm);
}
self.check_forbid_output(&output_to_check, &proc_res);

if self.props.run_rustfix && self.config.compare_mode.is_none() {
// And finally, compile the fixed code and make sure it both
Expand Down
Loading