Force valgrind to not be used for Python tests
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 21 Apr 2009 11:13:19 +0100
changeset 4388 fd90dd412e67
parent 4387 dff0992d7cce
child 4391 0868b79a6be4
Force valgrind to not be used for Python tests
regression.py
wscript
wutils.py
--- a/regression.py	Tue Apr 21 10:55:07 2009 +0100
+++ b/regression.py	Tue Apr 21 11:13:19 2009 +0100
@@ -159,7 +159,7 @@
             script = os.path.abspath(os.path.join('..', *os.path.split(program)))
             argv = [self.env['PYTHON'], script] + arguments
             try:
-                wutils.run_argv(argv, self.env, cwd=trace_output_path)
+                wutils.run_argv(argv, self.env, cwd=trace_output_path, force_no_valgrind=True)
             except Utils.WafError, ex:
                 print >> sys.stderr, ex
                 return 1
@@ -191,7 +191,7 @@
             script = os.path.abspath(os.path.join('..', *os.path.split(program)))
             argv = [self.env['PYTHON'], script] + arguments
             try:
-                retval = wutils.run_argv(argv, self.env, cwd=trace_output_path)
+                retval = wutils.run_argv(argv, self.env, cwd=trace_output_path, force_no_valgrind=True)
             except Utils.WafError, ex:
                 print >> sys.stderr, ex
                 return 1
--- a/wscript	Tue Apr 21 10:55:07 2009 +0100
+++ b/wscript	Tue Apr 21 11:13:19 2009 +0100
@@ -525,7 +525,8 @@
 
     if env['ENABLE_PYTHON_BINDINGS']:
         print "-- Running NS-3 Python bindings unit tests..."
-        wutils.run_argv([env['PYTHON'], os.path.join("utils", "python-unit-tests.py")], env, proc_env)
+        wutils.run_argv([env['PYTHON'], os.path.join("utils", "python-unit-tests.py")],
+                        env, proc_env, force_no_valgrind=True)
     else:
         print "-- Skipping NS-3 Python bindings unit tests: Python bindings not enabled."
 
--- a/wutils.py	Tue Apr 21 10:55:07 2009 +0100
+++ b/wutils.py	Tue Apr 21 11:13:19 2009 +0100
@@ -114,9 +114,9 @@
 
     return proc_env
 
-def run_argv(argv, env, os_env=None, cwd=None):
+def run_argv(argv, env, os_env=None, cwd=None, force_no_valgrind=False):
     proc_env = get_proc_env(os_env)
-    if Options.options.valgrind:
+    if Options.options.valgrind and not force_no_valgrind:
         if Options.options.command_template:
             raise Utils.WafError("Options --command-template and --valgrind are conflicting")
         if not env['VALGRIND']: