about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-03-09 14:29:55 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-03-11 21:37:21 +0300
commit2060d49c39e41a286b0425cb2f7ba6022a2d4b96 (patch)
tree47514898f6a35bd3774ac1a64a77bde7fe4d836c /src/tools/compiletest
parentde5c3c4b07fb37028bb36b2271271caf24eec6f3 (diff)
downloadrust-2060d49c39e41a286b0425cb2f7ba6022a2d4b96.tar.gz
rust-2060d49c39e41a286b0425cb2f7ba6022a2d4b96.zip
compiletest: Filter away test annotations from UI test output
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/runtest.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index bac41a7c579..68ecc0527bc 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -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();