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

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

Issue 655543005: Added support of shared_library build for tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments formatting in GYPs Created 6 years, 2 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/native_app_dependencies.gypi ('k') | sandbox/linux/sandbox_linux.gypi » ('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 b0be35ca8a47a55ed737ccbf7cb54f6a97791687..8f863f799626191511e4fc03f64322884f6b195d 100644
--- a/build/android/pylib/gtest/test_package_exe.py
+++ b/build/android/pylib/gtest/test_package_exe.py
@@ -93,16 +93,20 @@ class TestPackageExecutable(TestPackage):
sh_script_file = tempfile.NamedTemporaryFile()
# We need to capture the exit status from the script since adb shell won't
# propagate to us.
- sh_script_file.write('cd %s\n'
- '%s'
- '%s %s/%s --gtest_filter=%s %s\n'
- 'echo $? > %s' %
- (constants.TEST_EXECUTABLE_DIR,
- self._AddNativeCoverageExports(device),
- tool_wrapper, constants.TEST_EXECUTABLE_DIR,
- self.suite_name,
- test_filter, test_arguments,
- TestPackageExecutable._TEST_RUNNER_RET_VAL_FILE))
+ sh_script_file.write(
+ 'cd %s\n'
+ '%s'
+ '%s LD_LIBRARY_PATH=%s/%s_deps %s/%s --gtest_filter=%s %s\n'
+ 'echo $? > %s' %
+ (constants.TEST_EXECUTABLE_DIR,
+ self._AddNativeCoverageExports(device),
+ tool_wrapper,
+ constants.TEST_EXECUTABLE_DIR,
+ self.suite_name,
+ constants.TEST_EXECUTABLE_DIR,
+ self.suite_name,
+ test_filter, test_arguments,
+ TestPackageExecutable._TEST_RUNNER_RET_VAL_FILE))
sh_script_file.flush()
cmd_helper.RunCmd(['chmod', '+x', sh_script_file.name])
device.PushChangedFiles([(
@@ -114,12 +118,15 @@ class TestPackageExecutable(TestPackage):
#override
def GetAllTests(self, device):
- all_tests = device.RunShellCommand(
- '%s %s/%s --gtest_list_tests' %
- (self.tool.GetTestWrapper(),
- constants.TEST_EXECUTABLE_DIR,
- self.suite_name))
- return self._ParseGTestListTests(all_tests)
+ 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))
+ return self._ParseGTestListTests(output)
#override
def SpawnTestProcess(self, device):
@@ -147,5 +154,8 @@ class TestPackageExecutable(TestPackage):
(target_name, target_mtime, self.suite_path, source_mtime,
self.suite_name + '_stripped'))
- test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name
- device.PushChangedFiles([(target_name, test_binary)])
+ test_binary_path = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name
+ device.PushChangedFiles([(target_name, test_binary_path)])
+ deps_path = self.suite_path + '_deps'
+ if os.path.isdir(deps_path):
+ device.PushChangedFiles([(deps_path, test_binary_path + '_deps')])
« no previous file with comments | « build/android/native_app_dependencies.gypi ('k') | sandbox/linux/sandbox_linux.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698