glsl/tests: Use splitlines() instead of strip()
authorMichel Dänzer <mdaenzer@redhat.com>
Wed, 20 Nov 2019 10:15:04 +0000 (11:15 +0100)
committerMichel Dänzer <michel@daenzer.net>
Thu, 5 Dec 2019 11:31:17 +0000 (12:31 +0100)
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@pnwbakers.com>
src/compiler/glsl/tests/warnings_test.py

index ed0774880d3ec251dcff16d1497bf47a3d5af7b0..6cd3fbf294f8ee98492b5a2cf848de5684326b88 100644 (file)
@@ -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')