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

Unified Diff: build/android/pylib/gtest/single_test_runner.py

Issue 11901003: [Android] Reland 'Keep track of unknown test results at the TestRunner layer.' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « build/android/pylib/base/test_result.py ('k') | build/android/pylib/gtest/test_package.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/single_test_runner.py
diff --git a/build/android/pylib/gtest/single_test_runner.py b/build/android/pylib/gtest/single_test_runner.py
index 43959ee74250a3fa36973810a615619aca31aacf..9947ab4b9de59e164556e295fbfe8f6614e3659b 100644
--- a/build/android/pylib/gtest/single_test_runner.py
+++ b/build/android/pylib/gtest/single_test_runner.py
@@ -247,23 +247,25 @@ class SingleTestRunner(BaseTestRunner):
Returns:
A TestResults object.
"""
- try:
- self.test_package.CreateTestRunnerScript(self._gtest_filter,
- self._test_arguments)
- self.test_results = self.test_package.RunTestsAndListResults()
- except errors.DeviceUnresponsiveError as e:
- # Make sure this device is not attached
- if android_commands.IsDeviceAttached(self.device):
- raise e
-
- # TODO(frankf): We should report these as "skipped" not "failures".
- # Wrap the results
- logging.warning(e)
- failed_tests = []
- for t in self._gtest_filter.split(':'):
- failed_tests += [BaseTestResult(t, '')]
- self.test_results = TestResults.FromRun(
- failed=failed_tests, device_exception=self.device)
+ if self._gtest_filter:
+ try:
+ self.test_package.CreateTestRunnerScript(self._gtest_filter,
+ self._test_arguments)
+ self.test_results = self.test_package.RunTestsAndListResults()
+ except errors.DeviceUnresponsiveError as e:
+ # Make sure this device is not attached
+ logging.warning(e)
+ if android_commands.IsDeviceAttached(self.device):
+ raise e
+ self.test_results.device_exception = device_exception
+ # Calculate unknown test results.
+ finally:
+ # TODO(frankf): Do not break TestResults encapsulation.
+ all_tests = set(self._gtest_filter.split(':'))
+ all_tests_ran = set([t.name for t in self.test_results.GetAll()])
+ unknown_tests = all_tests - all_tests_ran
+ self.test_results.unknown = [BaseTestResult(t, '') for t in
+ unknown_tests]
return self.test_results
« no previous file with comments | « build/android/pylib/base/test_result.py ('k') | build/android/pylib/gtest/test_package.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698