Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: tools/valgrind/valgrind_test.py

Issue 3389023: Fix lost suppressions with --tool=tsan_rv and refactor chrome_tests/valgrind_... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/valgrind/chrome_tests.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/valgrind/valgrind_test.py
===================================================================
--- tools/valgrind/valgrind_test.py (revision 60037)
+++ tools/valgrind/valgrind_test.py (working copy)
@@ -207,7 +207,17 @@
logging.info("elapsed time: %02d:%02d:%02d" % (hours, minutes, seconds))
return retcode
+ def Run(self, args, module):
+ MODULES_TO_SANITY_CHECK = ["base"]
+ # TODO(timurrrr): this is a temporary workaround for http://crbug.com/47844
+ if self.ToolName() == "tsan" and common.IsMac():
+ MODULES_TO_SANITY_CHECK = []
+
+ check_sanity = module in MODULES_TO_SANITY_CHECK
+ return self.Main(args, check_sanity)
+
+
class ValgrindTool(BaseTool):
"""Abstract class for running Valgrind tools.
@@ -871,6 +881,9 @@
else:
return ThreadSanitizerRV2Posix()
+ def ToolName(self):
+ return "tsan"
+
def Main(self, args, check_sanity):
logging.info("Running a TSan + RaceVerifier test. For more information, " +
"see " + self.MORE_INFO_URL)
@@ -889,7 +902,10 @@
"on RaceVerifier")
return ret
+ def Run(self, args, module):
+ return self.Main(args, False)
+
class ToolFactory:
def Create(self, tool_name):
if tool_name == "memcheck" and not common.IsWine():
@@ -912,32 +928,9 @@
raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name,
platform_name)
-def RunTool(argv, module):
- # TODO(timurrrr): customize optparse instead
- tool_name = "memcheck"
- args = argv[1:]
- for arg in args:
- if arg.startswith("--tool="):
- tool_name = arg[7:]
- args.remove(arg)
- break
+def CreateTool(tool):
+ return ToolFactory().Create(tool)
- tool = ToolFactory().Create(tool_name)
- MODULES_TO_SANITY_CHECK = ["base"]
-
- # TODO(timurrrr): this is a temporary workaround for http://crbug.com/47844
- if tool_name == "tsan" and common.IsMac():
- MODULES_TO_SANITY_CHECK = []
-
- check_sanity = module in MODULES_TO_SANITY_CHECK
- return tool.Main(args, check_sanity)
-
-if __name__ == "__main__":
- if sys.argv.count("-v") > 0 or sys.argv.count("--verbose") > 0:
- logging_utils.config_root(logging.DEBUG)
- else:
- logging_utils.config_root()
- # TODO(timurrrr): valgrind tools may use -v/--verbose as well
-
- ret = RunTool(sys.argv)
- sys.exit(ret)
+if __name__ == '__main__':
+ logging.error(sys.argv[0] + " can not be run from command line")
+ sys.exit(1)
« no previous file with comments | « tools/valgrind/chrome_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698