Mesa (master): glsl/tests: Use splitlines() instead of strip()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 5 11:52:25 UTC 2019


Module: Mesa
Branch: master
Commit: f6a913bb9540a9c3fa5a22ad5e08dfe87dafdaaf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f6a913bb9540a9c3fa5a22ad5e08dfe87dafdaaf

Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Wed Nov 20 11:15:04 2019 +0100

glsl/tests: Use splitlines() instead of strip()

strip() removes leading and trailing newlines, but leaves newlines
between multiple lines in the string. This could cause failures when
comparing the output of cross-compiled Windows binaries (producing
Windows-style newlines) to the expected output with Unix-style newlines.

Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

---

 src/compiler/glsl/tests/warnings_test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/tests/warnings_test.py b/src/compiler/glsl/tests/warnings_test.py
index ed0774880d3..6cd3fbf294f 100644
--- a/src/compiler/glsl/tests/warnings_test.py
+++ b/src/compiler/glsl/tests/warnings_test.py
@@ -65,11 +65,11 @@ def main():
         file = os.path.join(args.test_directory, file)
 
         with open('{}.expected'.format(file), 'rb') as f:
-            expected = f.read().strip()
+            expected = f.read().splitlines()
 
         actual = subprocess.check_output(
             runner + ['--just-log', '--version', '150', file]
-        ).strip()
+        ).splitlines()
 
         if actual == expected:
             print('PASS')




More information about the mesa-commit mailing list