From 9ac80c6e578d208f354e10b6b794b89eb3c1934e Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Sun, 19 Jan 2014 13:53:21 -0800 Subject: [PATCH] Bug 958376 - |mach valgrind-test|: Add a --suppressions option. r=gps. --HG-- extra : rebase_source : 2e8e6618bb3b1a68ee25efb4c76acb8e53a5a4b2 --- build/valgrind/mach_commands.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build/valgrind/mach_commands.py b/build/valgrind/mach_commands.py index 4f43c4ba6462..db0ef2308810 100644 --- a/build/valgrind/mach_commands.py +++ b/build/valgrind/mach_commands.py @@ -8,8 +8,9 @@ import os import subprocess from mach.decorators import ( - CommandProvider, Command, + CommandArgument, + CommandProvider, ) from mozbuild.base import ( MachCommandBase, @@ -34,7 +35,12 @@ class MachCommands(MachCommandBase): @Command('valgrind-test', category='testing', conditions=[conditions.is_firefox, is_valgrind_build], description='Run the Valgrind test job.') - def valgrind_test(self): + @CommandArgument('--suppressions', default=[], action='append', + metavar='FILENAME', + help='Specify a suppression file for Valgrind to use. Use ' + '--suppression multiple times to specify multiple suppression ' + 'files.') + def valgrind_test(self, suppressions): import json import sys import tempfile @@ -101,6 +107,9 @@ class MachCommands(MachCommandBase): '--track-origins=yes' ] + for s in suppressions: + valgrind_args.append('--suppressions=' + s) + supps_dir = os.path.join(build_dir, 'valgrind') supps_file1 = os.path.join(supps_dir, 'cross-architecture.sup') valgrind_args.append('--suppressions=' + supps_file1)