summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-02 23:59:04 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-02 23:59:04 +0000
commit9351299cc8a50356d02d340839f679175c342ffd (patch)
tree50c4c7bca2ab66b65135b736a2e46be086fda2a4
parentfe38b1e0819183558d08d3ed3bb0d46f9ce9f961 (diff)
downloadchromium_src-9351299cc8a50356d02d340839f679175c342ffd.zip
chromium_src-9351299cc8a50356d02d340839f679175c342ffd.tar.gz
chromium_src-9351299cc8a50356d02d340839f679175c342ffd.tar.bz2
Memory scripts: Accept --build-dir in addition to --build_dir.
Many more tools accept --build-dir, so try to standardize at that. (Keep --build_dir around for a while longer so that we can change the bot configs to the new flag first.) Most of memory tools use --under_flags, so this increases self-inconsistency a bit, but they already have some --dash-flags (e.g. --help-tests) and the remaining flags are mostly --gtest_filter and friends. Change --source_dir to --source-dir at least to keep it similar to --build-dir. (And remove --source_dir from tsan_analyze.py, where it was unused.) BUG=294387 R=scottmg@chromium.org TBR=thestig Review URL: https://codereview.chromium.org/25815003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226623 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xppapi/native_client/tools/browser_tester/browser_tester.py2
-rwxr-xr-xtools/heapcheck/chrome_tests.py6
-rwxr-xr-xtools/valgrind/chrome_tests.py14
-rwxr-xr-xtools/valgrind/drmemory_analyze.py5
-rwxr-xr-xtools/valgrind/memcheck_analyze.py2
-rwxr-xr-xtools/valgrind/tsan_analyze.py15
-rw-r--r--tools/valgrind/valgrind_test.py6
7 files changed, 22 insertions, 28 deletions
diff --git a/ppapi/native_client/tools/browser_tester/browser_tester.py b/ppapi/native_client/tools/browser_tester/browser_tester.py
index 0fef6ea..e22bfde 100755
--- a/ppapi/native_client/tools/browser_tester/browser_tester.py
+++ b/ppapi/native_client/tools/browser_tester/browser_tester.py
@@ -161,7 +161,7 @@ def ProcessToolLogs(options, logs_dir):
analyzer = memcheck_analyze.MemcheckAnalyzer('', use_gdb=True)
logs_wildcard = 'xml.*'
elif options.tool == 'tsan':
- analyzer = tsan_analyze.TsanAnalyzer('', use_gdb=True)
+ analyzer = tsan_analyze.TsanAnalyzer(use_gdb=True)
logs_wildcard = 'log.*'
files = glob.glob(os.path.join(logs_dir, logs_wildcard))
retcode = analyzer.Report(files, options.url)
diff --git a/tools/heapcheck/chrome_tests.py b/tools/heapcheck/chrome_tests.py
index 444df8e..c96adc9 100755
--- a/tools/heapcheck/chrome_tests.py
+++ b/tools/heapcheck/chrome_tests.py
@@ -394,7 +394,7 @@ class ChromeTests(object):
# so parse it out of build_dir. run_webkit_tests.py can only handle
# the two values "Release" and "Debug".
# TODO(Hercules): unify how all our scripts pass around build mode
- # (--mode / --target / --build_dir / --debug)
+ # (--mode / --target / --build-dir / --debug)
if self._options.build_dir.endswith("Debug"):
script_cmd.append("--debug");
if (chunk_size > 0):
@@ -471,7 +471,9 @@ def main():
parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> "
"[-t <test> ...]")
parser.disable_interspersed_args()
- parser.add_option("-b", "--build_dir",
+ parser.add_option("-b", "--build-dir",
+ # TODO(thakis): Remove --build_dir once bots don't pass it.
+ "--build_dir",
help="the location of the output of the compiler output")
parser.add_option("-t", "--test", action="append",
help="which test to run")
diff --git a/tools/valgrind/chrome_tests.py b/tools/valgrind/chrome_tests.py
index a516fb3..721deec 100755
--- a/tools/valgrind/chrome_tests.py
+++ b/tools/valgrind/chrome_tests.py
@@ -57,7 +57,7 @@ class ChromeTests:
# an absolute Unix-style path
self._source_dir = os.path.abspath(self._source_dir).replace('\\', '/')
valgrind_test_script = os.path.join(script_dir, "valgrind_test.py")
- self._command_preamble = ["--source_dir=%s" % (self._source_dir)]
+ self._command_preamble = ["--source-dir=%s" % (self._source_dir)]
if not self._options.build_dir:
dirs = [
@@ -69,7 +69,7 @@ class ChromeTests:
if len(build_dir) > 1:
raise BuildDirAmbiguous("Found more than one suitable build dir:\n"
"%s\nPlease specify just one "
- "using --build_dir" % ", ".join(build_dir))
+ "using --build-dir" % ", ".join(build_dir))
elif build_dir:
self._options.build_dir = build_dir[0]
else:
@@ -77,12 +77,12 @@ class ChromeTests:
if self._options.build_dir:
build_dir = os.path.abspath(self._options.build_dir)
- self._command_preamble += ["--build_dir=%s" % (self._options.build_dir)]
+ self._command_preamble += ["--build-dir=%s" % (self._options.build_dir)]
def _EnsureBuildDirFound(self):
if not self._options.build_dir:
raise BuildDirNotFound("Oops, couldn't find a build dir, please "
- "specify it manually using --build_dir")
+ "specify it manually using --build-dir")
def _DefaultCommand(self, tool, exe=None, valgrind_test_args=None):
'''Generates the default command array that most tests will use.'''
@@ -443,7 +443,7 @@ class ChromeTests:
# so parse it out of build_dir. run_webkit_tests.py can only handle
# the two values "Release" and "Debug".
# TODO(Hercules): unify how all our scripts pass around build mode
- # (--mode / --target / --build_dir / --debug)
+ # (--mode / --target / --build-dir / --debug)
if self._options.build_dir:
build_root, mode = os.path.split(self._options.build_dir)
script_cmd.extend(["--build-directory", build_root, "--target", mode])
@@ -570,7 +570,9 @@ def _main():
parser.add_option("", "--help-tests", dest="help_tests", action="store_true",
default=False, help="List all available tests")
- parser.add_option("-b", "--build_dir",
+ parser.add_option("-b", "--build-dir",
+ # TODO(thakis): Remove --build_dir once bots don't pass it.
+ "--build_dir",
help="the location of the compiler output")
parser.add_option("-t", "--test", action="append", default=[],
help="which test to run, supports test:gtest_filter format "
diff --git a/tools/valgrind/drmemory_analyze.py b/tools/valgrind/drmemory_analyze.py
index 97d4635..7a82b46 100755
--- a/tools/valgrind/drmemory_analyze.py
+++ b/tools/valgrind/drmemory_analyze.py
@@ -178,10 +178,7 @@ class DrMemoryAnalyzer:
def main():
'''For testing only. The DrMemoryAnalyze class should be imported instead.'''
- parser = optparse.OptionParser("usage: %prog [options] <files to analyze>")
- parser.add_option("", "--source_dir",
- help="path to top of source tree for this build"
- "(used to normalize source paths in baseline)")
+ parser = optparse.OptionParser("usage: %prog <files to analyze>")
(options, args) = parser.parse_args()
if len(args) == 0:
diff --git a/tools/valgrind/memcheck_analyze.py b/tools/valgrind/memcheck_analyze.py
index 91795df..0b01129 100755
--- a/tools/valgrind/memcheck_analyze.py
+++ b/tools/valgrind/memcheck_analyze.py
@@ -617,7 +617,7 @@ class MemcheckAnalyzer:
def _main():
'''For testing only. The MemcheckAnalyzer class should be imported instead.'''
parser = optparse.OptionParser("usage: %prog [options] <files to analyze>")
- parser.add_option("", "--source_dir",
+ parser.add_option("", "--source-dir",
help="path to top of source tree for this build"
"(used to normalize source paths in baseline)")
diff --git a/tools/valgrind/tsan_analyze.py b/tools/valgrind/tsan_analyze.py
index 1950f6e..2c744e2 100755
--- a/tools/valgrind/tsan_analyze.py
+++ b/tools/valgrind/tsan_analyze.py
@@ -59,12 +59,8 @@ class TsanAnalyzer(object):
RACE_VERIFIER_LINE = "Confirmed a race|unexpected race"
TSAN_ASSERTION = "Assertion failed: "
- def __init__(self, source_dir, use_gdb=False):
- '''Reads in a set of files.
-
- Args:
- source_dir: Path to top of source tree for this build
- '''
+ def __init__(self, use_gdb=False):
+ '''Reads in a set of files.'''
self._use_gdb = use_gdb
self._cur_testcase = None
@@ -259,10 +255,7 @@ class TsanAnalyzer(object):
def main():
'''For testing only. The TsanAnalyzer class should be imported instead.'''
- parser = optparse.OptionParser("usage: %prog [options] <files to analyze>")
- parser.add_option("", "--source_dir",
- help="path to top of source tree for this build"
- "(used to normalize source paths in baseline)")
+ parser = optparse.OptionParser("usage: %prog <files to analyze>")
(options, args) = parser.parse_args()
if not args:
@@ -270,7 +263,7 @@ def main():
filenames = args
logging.getLogger().setLevel(logging.INFO)
- analyzer = TsanAnalyzer(options.source_dir, use_gdb=True)
+ analyzer = TsanAnalyzer(use_gdb=True)
return analyzer.Report(filenames, None)
diff --git a/tools/valgrind/valgrind_test.py b/tools/valgrind/valgrind_test.py
index 89fc034..139f3ec 100644
--- a/tools/valgrind/valgrind_test.py
+++ b/tools/valgrind/valgrind_test.py
@@ -81,9 +81,9 @@ class BaseTool(object):
self._parser.add_option("-t", "--timeout",
dest="timeout", metavar="TIMEOUT", default=10000,
help="timeout in seconds for the run (default 10000)")
- self._parser.add_option("", "--build_dir",
+ self._parser.add_option("", "--build-dir",
help="the location of the compiler output")
- self._parser.add_option("", "--source_dir",
+ self._parser.add_option("", "--source-dir",
help="path to top of source tree for this build"
"(used to normalize source paths in baseline)")
self._parser.add_option("", "--gtest_filter", default="",
@@ -729,7 +729,7 @@ class ThreadSanitizerPosix(ThreadSanitizerBase, ValgrindTool):
def CreateAnalyzer(self):
use_gdb = common.IsMac()
- return tsan_analyze.TsanAnalyzer(self._source_dir, use_gdb)
+ return tsan_analyze.TsanAnalyzer(use_gdb)
def Analyze(self, check_sanity=False):
ret = self.GetAnalyzeResults(check_sanity)