Skip to content

Commit 2f17ea0

Browse files
committed
Remove //@ compare-output-lines-by-subset
There was only ever one test which used this flag, and it was removed in rust-lang#132244. I think this is a bad flag that should never have been added; comparing by subset makes the test failures extremely hard to debug. Any test that needs complicated output filtering like this should just use run-make instead. Note that this does not remove the underlying comparison code, because it's still used if `runner` is set. I don't quite understand what's going on there, but since we still test on other platforms and in CI that the full output is accurate, I think it will be easier to debug than a test that uses compare-by-subset unconditionally.
1 parent 5bbbc09 commit 2f17ea0

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

Diff for: src/tools/compiletest/src/directive-list.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
1717
"check-run-results",
1818
"check-stdout",
1919
"check-test-line-numbers-match",
20-
"compare-output-lines-by-subset",
2120
"compile-flags",
2221
"doc-flags",
2322
"dont-check-compiler-stderr",

Diff for: src/tools/compiletest/src/header.rs

-10
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ pub struct TestProps {
115115
pub dont_check_compiler_stdout: bool,
116116
// For UI tests, allows compiler to generate arbitrary output to stderr
117117
pub dont_check_compiler_stderr: bool,
118-
// When checking the output of stdout or stderr check
119-
// that the lines of expected output are a subset of the actual output.
120-
pub compare_output_lines_by_subset: bool,
121118
// Don't force a --crate-type=dylib flag on the command line
122119
//
123120
// Set this for example if you have an auxiliary test file that contains
@@ -240,7 +237,6 @@ mod directives {
240237
pub const KNOWN_BUG: &'static str = "known-bug";
241238
pub const TEST_MIR_PASS: &'static str = "test-mir-pass";
242239
pub const REMAP_SRC_BASE: &'static str = "remap-src-base";
243-
pub const COMPARE_OUTPUT_LINES_BY_SUBSET: &'static str = "compare-output-lines-by-subset";
244240
pub const LLVM_COV_FLAGS: &'static str = "llvm-cov-flags";
245241
pub const FILECHECK_FLAGS: &'static str = "filecheck-flags";
246242
pub const NO_AUTO_CHECK_CFG: &'static str = "no-auto-check-cfg";
@@ -274,7 +270,6 @@ impl TestProps {
274270
check_run_results: false,
275271
dont_check_compiler_stdout: false,
276272
dont_check_compiler_stderr: false,
277-
compare_output_lines_by_subset: false,
278273
no_prefer_dynamic: false,
279274
pretty_mode: "normal".to_string(),
280275
pretty_compare_only: false,
@@ -550,11 +545,6 @@ impl TestProps {
550545
|s| s.trim().to_string(),
551546
);
552547
config.set_name_directive(ln, REMAP_SRC_BASE, &mut self.remap_src_base);
553-
config.set_name_directive(
554-
ln,
555-
COMPARE_OUTPUT_LINES_BY_SUBSET,
556-
&mut self.compare_output_lines_by_subset,
557-
);
558548

559549
if let Some(flags) = config.parse_name_value_directive(ln, LLVM_COV_FLAGS) {
560550
self.llvm_cov_flags.extend(split_flags(&flags));

Diff for: src/tools/compiletest/src/runtest.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -2541,13 +2541,10 @@ impl<'test> TestCx<'test> {
25412541
return 0;
25422542
}
25432543

2544-
// If `compare-output-lines-by-subset` is not explicitly enabled then
2545-
// auto-enable it when a `runner` is in use since wrapper tools might
2546-
// provide extra output on failure, for example a WebAssembly runtime
2547-
// might print the stack trace of an `unreachable` instruction by
2548-
// default.
2549-
let compare_output_by_lines =
2550-
self.props.compare_output_lines_by_subset || self.config.runner.is_some();
2544+
// Wrapper tools set by `runner` might provide extra output on failure,
2545+
// for example a WebAssembly runtime might print the stack trace of an
2546+
// `unreachable` instruction by default.
2547+
let compare_output_by_lines = self.config.runner.is_some();
25512548

25522549
let tmp;
25532550
let (expected, actual): (&str, &str) = if compare_output_by_lines {

0 commit comments

Comments
 (0)