about summary refs log tree commit diff
diff options
context:
space:
mode:
authormemoryleak47 <memoryleak47@protonmail.ch>2018-03-23 15:31:05 +0100
committermemoryleak47 <memoryleak47@protonmail.ch>2018-03-23 15:31:05 +0100
commitda1febff1eb29172f8f464360d0358ef66414488 (patch)
treed15760dd8cd2c319a87b6d01aafceafa323ce1fb
parentbb7ab5c85db7954f2662e84a88610b8b39b501c7 (diff)
downloadrust-da1febff1eb29172f8f464360d0358ef66414488.tar.gz
rust-da1febff1eb29172f8f464360d0358ef66414488.zip
the expected ui output is now the empty String if the corresponding files are missing
-rw-r--r--src/tools/compiletest/src/runtest.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 540ff13eae5..320bca7bb64 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2802,7 +2802,7 @@ impl<'test> TestCx<'test> {
         normalized
     }
 
-    fn expected_output_path(&self, kind: &str) -> Result<PathBuf, String> {
+    fn load_expected_output(&self, kind: &str) -> String {
         let mut path = expected_output_path(&self.testpaths,
                                             self.revision,
                                             &self.config.compare_mode,
@@ -2814,18 +2814,15 @@ impl<'test> TestCx<'test> {
         }
 
         if path.exists() {
-            Ok(path)
+            match self.load_expected_output_from_path(&path) {
+                Ok(x) => x,
+                Err(x) => self.fatal(&x),
+            }
         } else {
-            Err(String::from("no existing output_path found"))
+            String::new()
         }
     }
 
-    fn load_expected_output(&self, kind: &str) -> String {
-        self.expected_output_path(kind)
-            .and_then(|x| self.load_expected_output_from_path(&x))
-            .unwrap_or_else(|x| self.fatal(&x))
-    }
-
     fn load_expected_output_from_path(&self, path: &Path) -> Result<String, String> {
         let mut result = String::new();
         match File::open(path).and_then(|mut f| f.read_to_string(&mut result)) {