From f0f6aec5459412b52b334b70f939f196ce870b73 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 15 Dec 2021 15:01:17 -0800 Subject: [PATCH] glcpp: Disable the valgrind tests. We have the glcpp unit tests covered with ASan and MSan in CI, no need to make everyone doing a "meson test" suffer through valgrind slowly churning through these. Reviewed-by: Christian Gmeiner Part-of: --- src/compiler/glsl/glcpp/meson.build | 14 --------- src/compiler/glsl/glcpp/tests/glcpp_test.py | 46 ----------------------------- 2 files changed, 60 deletions(-) diff --git a/src/compiler/glsl/glcpp/meson.build b/src/compiler/glsl/glcpp/meson.build index 4614310..725ffe7 100644 --- a/src/compiler/glsl/glcpp/meson.build +++ b/src/compiler/glsl/glcpp/meson.build @@ -112,18 +112,4 @@ if with_any_opengl and with_tests and meson.has_exe_wrapper() and \ timeout: 60, ) endforeach - - if dep_valgrind.found() - test( - 'glcpp test (valgrind)', - prog_python, - args : [ - join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'), - glcpp, join_paths(meson.current_source_dir(), 'tests'), - '--valgrind', - ], - suite : ['compiler', 'glcpp'], - timeout: 240, - ) - endif endif diff --git a/src/compiler/glsl/glcpp/tests/glcpp_test.py b/src/compiler/glsl/glcpp/tests/glcpp_test.py index b034754..1b31adf 100644 --- a/src/compiler/glsl/glcpp/tests/glcpp_test.py +++ b/src/compiler/glsl/glcpp/tests/glcpp_test.py @@ -45,7 +45,6 @@ def arg_parser(): parser.add_argument('--windows', action='store_true', help='Run tests for Windows/Dos style newlines') parser.add_argument('--oldmac', action='store_true', help='Run tests for Old Mac (pre-OSX) style newlines') parser.add_argument('--bizarro', action='store_true', help='Run tests for Bizarro world style newlines') - parser.add_argument('--valgrind', action='store_true', help='Run with valgrind for errors') return parser.parse_args() @@ -88,23 +87,6 @@ def test_output(glcpp, contents, expfile, nl_format='\n'): return (False, difflib.unified_diff(actual.splitlines(), expected.splitlines())) -def _valgrind(glcpp, filename): - """Run valgrind and report any warnings.""" - with open(filename, 'rb') as f: - contents = f.read() - extra_args = parse_test_file(contents, nl_format='\n') - - proc = subprocess.Popen( - ['valgrind', '--error-exitcode=126'] + glcpp + extra_args, - stdout=subprocess.DEVNULL, - stderr=subprocess.PIPE, - stdin=subprocess.PIPE) - _, errors = proc.communicate(contents) - if proc.returncode != 126: - return (True, []) - return (False, errors.decode('utf-8')) - - def test_unix(args): """Test files with unix style (\n) new lines.""" total = 0 @@ -190,32 +172,6 @@ def test_bizarro(args): return _replace_test(args, '\n\r') -def test_valgrind(args): - total = 0 - passed = 0 - - print('============= Testing for Valgrind Warnings =============') - for filename in os.listdir(args.testdir): - if not filename.endswith('.c'): - continue - - print( '{}:'.format(os.path.splitext(filename)[0]), end=' ') - total += 1 - valid, log = _valgrind(args.glcpp, os.path.join(args.testdir, filename)) - if valid: - passed += 1 - print('PASS') - else: - print('FAIL') - print(log, file=sys.stderr) - - if not total: - raise Exception('Could not find any tests.') - - print('{}/{}'.format(passed, total), 'tests returned correct results') - return total == passed - - def main(): args = arg_parser() @@ -235,8 +191,6 @@ def main(): success = success and test_oldmac(args) if args.bizarro: success = success and test_bizarro(args) - if args.valgrind: - success = success and test_valgrind(args) except OSError as e: if e.errno == errno.ENOEXEC: print('Skipping due to inability to run host binaries.', -- 2.7.4