glcpp: Disable the valgrind tests.
authorEmma Anholt <emma@anholt.net>
Wed, 15 Dec 2021 23:01:17 +0000 (15:01 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 23 Dec 2021 09:10:11 +0000 (09:10 +0000)
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 <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14236>

src/compiler/glsl/glcpp/meson.build
src/compiler/glsl/glcpp/tests/glcpp_test.py

index 4614310..725ffe7 100644 (file)
@@ -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
index b034754..1b31adf 100644 (file)
@@ -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.',