Skip to content

Commit

Permalink
compiletest: Filter away test annotations from UI test output
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Mar 11, 2019
1 parent de5c3c4 commit 2060d49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Expand Up @@ -3083,6 +3083,12 @@ impl<'test> TestCx<'test> {
.replace("\\", "/") // normalize for paths on windows
.replace("\r\n", "\n") // normalize for linebreaks on windows
.replace("\t", "\\t"); // makes tabs visible

// Remove test annotations like `//~ ERROR text` from the output,
// since they duplicate actual errors and make the output hard to read.
normalized = Regex::new("\\s*//~.*").unwrap()
.replace_all(&normalized, "").into_owned();

for rule in custom_rules {
let re = Regex::new(&rule.0).expect("bad regex in custom normalization rule");
normalized = re.replace_all(&normalized, &rule.1[..]).into_owned();
Expand Down

0 comments on commit 2060d49

Please sign in to comment.