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

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

Issue 1108173002: Roll //build, //native_client, and a few more targets of opportunity. Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Test fix Created 5 years, 8 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/gtest/test_package_apk.py ('k') | build/android/pylib/gtest/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/test_package_exe.py
diff --git a/build/android/pylib/gtest/test_package_exe.py b/build/android/pylib/gtest/test_package_exe.py
index e607cad512aa90d06b7b60e698484f36fa634b0d..aa3374e29ce056ce839c364b1584b75cdf08bdc2 100644
--- a/build/android/pylib/gtest/test_package_exe.py
+++ b/build/android/pylib/gtest/test_package_exe.py
@@ -6,6 +6,7 @@
import logging
import os
+import posixpath
import sys
import tempfile
@@ -78,15 +79,7 @@ class TestPackageExecutable(TestPackage):
#override
def ClearApplicationState(self, device):
- try:
- # We don't expect the executable to be running, so we don't attempt
- # to retry on failure.
- device.KillAll(self.suite_name, blocking=True, timeout=30, retries=0)
- except device_errors.CommandFailedError:
- # KillAll raises an exception if it can't find a process with the given
- # name. We only care that there is no process with the given name, so
- # we can safely eat the exception.
- pass
+ device.KillAll(self.suite_name, blocking=True, timeout=30, quiet=True)
#override
def CreateCommandLineFileOnDevice(self, device, test_filter, test_arguments):
@@ -119,14 +112,19 @@ class TestPackageExecutable(TestPackage):
#override
def GetAllTests(self, device):
- cmd = '%s %s/%s --gtest_list_tests' % (self.tool.GetTestWrapper(),
- constants.TEST_EXECUTABLE_DIR, self.suite_name)
- lib_path = '%s/%s_deps' % (constants.TEST_EXECUTABLE_DIR, self.suite_name)
- (exit_code, output) = device.old_interface.GetAndroidToolStatusAndOutput(
- cmd, lib_path=lib_path)
- if exit_code != 0:
- raise Exception(
- 'Failed to start binary:\n%s' % '\n'.join(output))
+ lib_path = posixpath.join(
+ constants.TEST_EXECUTABLE_DIR, '%s_deps' % self.suite_name)
+
+ cmd = []
+ for wrapper in (device.GetDevicePieWrapper(), self.tool.GetTestWrapper()):
+ if wrapper:
+ cmd.append(wrapper)
+ cmd.extend([
+ posixpath.join(constants.TEST_EXECUTABLE_DIR, self.suite_name),
+ '--gtest_list_tests'])
+
+ output = device.RunShellCommand(
+ cmd, check_return=True, env={'LD_LIBRARY_PATH': lib_path})
return gtest_test_instance.ParseGTestListTests(output)
#override
« no previous file with comments | « build/android/pylib/gtest/test_package_apk.py ('k') | build/android/pylib/gtest/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698