qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject qpid-dispatch git commit: DISPATCH-236: Allow the valgrind tool and suppression file to be customized.
Date Fri, 11 Mar 2016 20:32:59 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master ad6d73ef6 -> c6ccf1e1b


DISPATCH-236: Allow the valgrind tool and suppression file to be customized.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/c6ccf1e1
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/c6ccf1e1
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/c6ccf1e1

Branch: refs/heads/master
Commit: c6ccf1e1b49eeb27279dba227dd01627a931e610
Parents: ad6d73e
Author: Kenneth Giusti <kgiusti@redhat.com>
Authored: Thu Mar 10 15:56:44 2016 -0500
Committer: Kenneth Giusti <kgiusti@redhat.com>
Committed: Fri Mar 11 15:05:14 2016 -0500

----------------------------------------------------------------------
 README    |  9 +++++++++
 run.py.in | 12 ++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/c6ccf1e1/README
----------------------------------------------------------------------
diff --git a/README b/README
index c6c59fd..2ae861e 100644
--- a/README
+++ b/README
@@ -69,3 +69,12 @@ If valgrind is installed it will be used by default when running the tests.
 Set the cmake option 'USE_VALGRIND' to 'ON' or 'OFF' to enable/disable valgrind.
 You can also set the environment variable 'USE_VALGRIND' to 'ON or 'OFF'.
 If set the environment variable takes precendence over the cmake option.
+
+By default valgrind uses the memcheck tool to find memory-related
+issues.  The tool can be overrided using the 'VALGRIND_TOOL'
+environment variable.  The location of the valgrind suppression file
+can be overrided by setting the 'VALGRIND_SUPPRESSIONS' environment
+variable to an alternate suppression file.  Additional valgrind
+options can be passed by setting the 'VALGRIND_OPTS' to a space
+separated string containing the additional options.
+E.g. VALGRIND_OPTS="--xml=yes --max-stackframe=10000000"

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/c6ccf1e1/run.py.in
----------------------------------------------------------------------
diff --git a/run.py.in b/run.py.in
index 45da991..eea8882 100755
--- a/run.py.in
+++ b/run.py.in
@@ -36,7 +36,11 @@ run.py --sh                                # Print a shell script to set
the run
 
 Valgrind can be enabled or disabled by the cmake 'USE_VALGRIND' option and the
 environment variable 'USE_VALGRIND' (set to 'ON' or 'OFF'). The environment
-variable takes precendence if set.
+variable takes precendence if set.  By default valgrind runs the 'memcheck'
+tool. The valgrind tool and supression file can be overridden by setting the
+'VALGRIND_TOOL' and 'VALGRIND_SUPPRESSIONS' environment variables,
+respectively. Additional options can be provided via the 'VALGRIND_OPTS'
+environment variable.
 """
 
 import os, sys, runpy
@@ -114,11 +118,15 @@ def with_valgrind(args, outfile=None):
         opts = ['--trace-children=yes',
                 #  '--leak-check=full',  way too noisy due to Python leaks
                 '--demangle=yes',
-                '--suppressions=${CMAKE_SOURCE_DIR}/tests/valgrind.supp',
                 '--num-callers=12',
                 '--error-exitcode=%d' % VALGRIND_ERROR,
                 '--quiet']
+        opts.append('--tool=%s' % os.environ.get('VALGRIND_TOOL', 'memcheck'))
+        supp = os.environ.get('VALGRIND_SUPPRESSIONS',
+                              '${CMAKE_SOURCE_DIR}/tests/valgrind.supp')
+        opts.append('--suppressions=%s' % supp)
         if outfile: opts.append('--log-file=%s' % outfile)
+        opts.extend(os.environ.get('VALGRIND_OPTS', "").split())
         return ([valgrind_exe]+opts+args, VALGRIND_ERROR)
     return (args, 0)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message