Skip to content

Commit 2060d49

Browse files
committed
compiletest: Filter away test annotations from UI test output
1 parent de5c3c4 commit 2060d49

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/tools/compiletest/src/runtest.rs

+6
Original file line numberDiff line numberDiff line change
@@ -3083,6 +3083,12 @@ impl<'test> TestCx<'test> {
30833083
.replace("\\", "/") // normalize for paths on windows
30843084
.replace("\r\n", "\n") // normalize for linebreaks on windows
30853085
.replace("\t", "\\t"); // makes tabs visible
3086+
3087+
// Remove test annotations like `//~ ERROR text` from the output,
3088+
// since they duplicate actual errors and make the output hard to read.
3089+
normalized = Regex::new("\\s*//~.*").unwrap()
3090+
.replace_all(&normalized, "").into_owned();
3091+
30863092
for rule in custom_rules {
30873093
let re = Regex::new(&rule.0).expect("bad regex in custom normalization rule");
30883094
normalized = re.replace_all(&normalized, &rule.1[..]).into_owned();

0 commit comments

Comments
 (0)