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:

committed by
Marge Bot

parent
b8c472c111
commit
b08f293686
@@ -83,10 +83,8 @@ glcpp = executable(
|
|||||||
#
|
#
|
||||||
# TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
|
# TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
|
||||||
# starting with Meson 0.55.0
|
# 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 \
|
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']
|
modes = ['unix', 'windows', 'oldmac', 'bizarro']
|
||||||
|
|
||||||
foreach m : modes
|
foreach m : modes
|
||||||
|
@@ -75,8 +75,8 @@ def test_output(glcpp, contents, expfile, nl_format='\n'):
|
|||||||
print("Test returned general error, possibly missing linker")
|
print("Test returned general error, possibly missing linker")
|
||||||
sys.exit(77)
|
sys.exit(77)
|
||||||
|
|
||||||
with open(expfile, 'r') as f:
|
with open(expfile, 'rb') as f:
|
||||||
expected = f.read()
|
expected = f.read().decode('utf-8')
|
||||||
|
|
||||||
# Bison 3.6 changed '$end' to 'end of file' in its error messages
|
# Bison 3.6 changed '$end' to 'end of file' in its error messages
|
||||||
# See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3181
|
# See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3181
|
||||||
|
Reference in New Issue
Block a user