[Git][ghc/ghc][master] testsuite: Don't attempt to read .std{err, out} files if they don't exist

Marge Bot gitlab at gitlab.haskell.org
Thu Apr 23 15:40:48 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
5946c85a by Ben Gamari at 2020-04-23T11:40:38-04:00
testsuite: Don't attempt to read .std{err,out} files if they don't exist

Simon reports that he was previously seeing framework failures due to
an attempt to read the non-existing T13456.stderr. While I don't know
exactly what this is due to, it does seem like a non-existing
.std{out,err} file should be equivalent to an empty file. Teach the
testsuite driver to treat it as such.

- - - - -


1 changed file:

- testsuite/driver/testlib.py


Changes:

=====================================
testsuite/driver/testlib.py
=====================================
@@ -1787,7 +1787,11 @@ def stdout_ok(name: TestName, way: WayName) -> bool:
                           expected_stdout_file, actual_stdout_file)
 
 def read_stdout( name: TestName ) -> str:
-    return in_testdir(name, 'run.stdout').read_text(encoding='UTF-8')
+    path = in_testdir(name, 'run.stdout')
+    if path.exists():
+        return path.read_text(encoding='UTF-8')
+    else:
+        return ''
 
 def dump_stdout( name: TestName ) -> None:
     s = read_stdout(name).strip()
@@ -1805,7 +1809,11 @@ def stderr_ok(name: TestName, way: WayName) -> bool:
                           whitespace_normaliser=normalise_whitespace)
 
 def read_stderr( name: TestName ) -> str:
-    return in_testdir(name, 'run.stderr').read_text(encoding='UTF-8')
+    path = in_testdir(name, 'run.stderr')
+    if path.exists():
+        return path.read_text(encoding='UTF-8')
+    else:
+        return ''
 
 def dump_stderr( name: TestName ) -> None:
     s = read_stderr(name).strip()



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5946c85abcf66555cdbcd3eed02cb8f512b6110c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5946c85abcf66555cdbcd3eed02cb8f512b6110c
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200423/e0c5075d/attachment-0001.html>


More information about the ghc-commits mailing list