| 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
|
|
|
|
|