From 7fedf51b959e0d18cefff7b8556578279eab21f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 6 Mar 2021 00:24:09 +0100 Subject: [PATCH] glsl/tests: Use exit code 126 to detect valgrind errors valgrind returns exit code 126 if it can't write to the file passed to --log-file. Hopefully it'll be the same for any other invalid valgrind command line parameters or internal errors as well. Using a different exit code (31) for this was hiding the fact that the valgrind test wasn't actually working. v2: * Use exit code 126; can't treat any non-0 exit code as failure because glcpp is expected to exit with non-0 for some of the input we feed it Reviewed-by: Dylan Baker # v1 Part-of: --- src/compiler/glsl/glcpp/tests/glcpp_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/glcpp/tests/glcpp_test.py b/src/compiler/glsl/glcpp/tests/glcpp_test.py index bbf348d0179..0772770f5b2 100644 --- a/src/compiler/glsl/glcpp/tests/glcpp_test.py +++ b/src/compiler/glsl/glcpp/tests/glcpp_test.py @@ -96,12 +96,12 @@ def _valgrind(glcpp, filename): extra_args = parse_test_file(contents, nl_format='\n') proc = subprocess.Popen( - ['valgrind', '--error-exitcode=31'] + glcpp + extra_args, + ['valgrind', '--error-exitcode=126'] + glcpp + extra_args, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, stdin=subprocess.PIPE) _, errors = proc.communicate(contents) - if proc.returncode != 31: + if proc.returncode != 126: return (True, []) return (False, errors.decode('utf-8'))