glsl/tests: do not perform eol-conversion on windows

These tests fail on Windows, because we open the expected files in
text-mode, performing EOL conversion. Instead, let's read them as binary
files, and manually UTF-8 decode them to get the expected result.

This fixes the tests on Windows for me.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18179>
This commit is contained in:
Erik Faye-Lund
2022-08-22 11:43:52 +02:00
committed by Marge Bot
parent b8c472c111
commit b08f293686
2 changed files with 3 additions and 5 deletions

View File

@@ -83,10 +83,8 @@ glcpp = executable(
#
# TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
# starting with Meson 0.55.0
#
# FIXME: these fail on windows due to whitespace differences
if with_any_opengl and with_tests and meson.has_exe_wrapper() and \
host_machine.system() != 'windows' and with_glcpp_tests
with_glcpp_tests
modes = ['unix', 'windows', 'oldmac', 'bizarro']
foreach m : modes

View File

@@ -75,8 +75,8 @@ def test_output(glcpp, contents, expfile, nl_format='\n'):
print("Test returned general error, possibly missing linker")
sys.exit(77)
with open(expfile, 'r') as f:
expected = f.read()
with open(expfile, 'rb') as f:
expected = f.read().decode('utf-8')
# Bison 3.6 changed '$end' to 'end of file' in its error messages
# See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3181