From 40b01df66eca8855d00a65baf27bd6bfd16454f6 Mon Sep 17 00:00:00 2001 From: "timurrrr@chromium.org" Date: Thu, 4 Mar 2010 16:15:41 +0000 Subject: Ignore exit code of Layout tests Review URL: http://codereview.chromium.org/669054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40628 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/valgrind/chrome_tests.py | 1 + tools/valgrind/valgrind_test.py | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/valgrind/chrome_tests.py b/tools/valgrind/chrome_tests.py index a7019e8..a14b5f6 100755 --- a/tools/valgrind/chrome_tests.py +++ b/tools/valgrind/chrome_tests.py @@ -298,6 +298,7 @@ class ChromeTests: cmd = self._DefaultCommand("webkit") cmd.append("--trace_children") cmd.append("--indirect") + cmd.append("--ignore_exit_code") # Now build script_cmd, the run_webkits_tests.py commandline # Store each chunk in its own directory so that we can find the data later chunk_dir = os.path.join("layout", "chunk_%05d" % chunk_num) diff --git a/tools/valgrind/valgrind_test.py b/tools/valgrind/valgrind_test.py index ef9caac..3666760 100755 --- a/tools/valgrind/valgrind_test.py +++ b/tools/valgrind/valgrind_test.py @@ -84,6 +84,10 @@ class ValgrindTool(object): self._parser.add_option("", "--nocleanup_on_exit", action="store_true", default=False, help="don't delete directory with logs on exit") + self._parser.add_option("", "--ignore_exit_code", action="store_true", + default=False, + help="ignore exit code of the test " + "(e.g. test failures)") self.ExtendOptionParser(self._parser) self._parser.description = __doc__ @@ -124,6 +128,7 @@ class ValgrindTool(object): self._suppressions = self._options.suppressions self._source_dir = self._options.source_dir self._nocleanup_on_exit = self._options.nocleanup_on_exit + self._ignore_exit_code = self._options.ignore_exit_code if self._options.gtest_filter != "": self._args.append("--gtest_filter=%s" % self._options.gtest_filter) if self._options.gtest_repeat: @@ -318,7 +323,7 @@ class ValgrindTool(object): common.RunSubprocess([os.environ.get('WINESERVER'), '-k']) return True - def RunTestsAndAnalyze(self, check_sanity=False): + def RunTestsAndAnalyze(self, check_sanity): self.PrepareForTest() exec_retcode = self.Execute() analyze_retcode = self.Analyze(check_sanity) @@ -328,10 +333,17 @@ class ValgrindTool(object): return analyze_retcode if exec_retcode: - logging.error("Test Execution failed.") - return exec_retcode + if self._ignore_exit_code: + logging.info("Test execution failed, but the exit code is ignored.") + else: + logging.error("Test execution failed.") + return exec_retcode + else: + logging.info("Test execution completed successfully.") + + if not analyze_retcode: + logging.info("Analysis completed successfully.") - logging.info("Execution and analysis completed successfully.") return 0 def CreateBrowserWrapper(self, command): @@ -351,7 +363,7 @@ class ValgrindTool(object): os.putenv("BROWSER_WRAPPER", indirect_fname) logging.info('export BROWSER_WRAPPER=' + indirect_fname) - def Main(self, args, check_sanity=False): + def Main(self, args, check_sanity): '''Call this to run through the whole process: Setup, Execute, Analyze''' start = datetime.datetime.now() retcode = -1 -- cgit v1.1