Mesa (main): glcpp: Disable the valgrind tests.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 23 09:40:48 UTC 2021


Module: Mesa
Branch: main
Commit: f0f6aec5459412b52b334b70f939f196ce870b73
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0f6aec5459412b52b334b70f939f196ce870b73

Author: Emma Anholt <emma at anholt.net>
Date:   Wed Dec 15 15:01:17 2021 -0800

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 <christian.gmeiner at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14236>

---

 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 4614310aee1..725ffe72440 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 b034754c963..1b31adf4528 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.',



More information about the mesa-commit mailing list