From 2ccbdbe2508fdf17fde95a96ee197d45faabe467 Mon Sep 17 00:00:00 2001 From: "erikkay@google.com" Date: Tue, 13 Jan 2009 16:48:01 +0000 Subject: A simple one-at-a-time test runner that can be driven by chrome_tests.py. This allows memory errors to be isolated to a particular test and a crash in one test to affect the tests of others. Review URL: http://codereview.chromium.org/17634 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7938 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/purify/chrome_tests.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tools/purify/chrome_tests.py') diff --git a/tools/purify/chrome_tests.py b/tools/purify/chrome_tests.py index fe30c3b..ce3e268 100644 --- a/tools/purify/chrome_tests.py +++ b/tools/purify/chrome_tests.py @@ -134,8 +134,14 @@ class ChromeTests: def SimpleTest(self, module, name): cmd = self._DefaultCommand(module, name) - self._ReadGtestFilterFile(name, cmd) - return common.RunSubprocess(cmd, 0) + if not self._options.run_singly: + self._ReadGtestFilterFile(name, cmd) + cmd.append("--gtest_print_time") + return common.RunSubprocess(cmd, 0) + else: + exe = cmd[-1] + script = ["python.exe", "test_runner.py", exe] + return self.ScriptedTest(module, exe, name, script, multi=True) def ScriptedTest(self, module, exe, name, script, multi=False, cmd_args=None, out_dir_extra=None): @@ -176,6 +182,7 @@ class ChromeTests: script[0] = os.path.join(self._options.build_dir, script[0]) cmd.extend(script) self._ReadGtestFilterFile(name, cmd) + cmd.append("--gtest_print_time") return common.RunSubprocess(cmd, 0) def InstrumentDll(self): @@ -310,6 +317,10 @@ def _main(argv): help="verbose output - enable debug log messages") parser.add_option("", "--no-reinstrument", action="store_true", default=False, help="Don't force a re-instrumentation for ui_tests") + parser.add_option("", "--run-singly", action="store_true", default=False, + help="run tests independently of each other so that they " + "don't interfere with each other and so that errors " + "can be accurately attributed to their source"); options, args = parser.parse_args() if options.verbose: -- cgit v1.1