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

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

Issue 18770008: [Android] Redesigns the sharder to allow replicated vs distributed tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-adds -f short form to gtest_filter switch Created 7 years, 5 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.py ('k') | build/android/pylib/gtest/test_package_exe.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_apk.py
diff --git a/build/android/pylib/gtest/test_package_apk.py b/build/android/pylib/gtest/test_package_apk.py
index 9670934d879e74c4a00577ac9bef80c03f24cb8c..27dad352b6cf57fcb652e918e995947592453e95 100644
--- a/build/android/pylib/gtest/test_package_apk.py
+++ b/build/android/pylib/gtest/test_package_apk.py
@@ -22,19 +22,25 @@ from test_package import TestPackage
class TestPackageApk(TestPackage):
"""A helper class for running APK-based native tests."""
- def __init__(self, adb, device, test_suite, tool, test_apk_package_name,
+ def __init__(self, adb, device, suite_path_full, tool, test_apk_package_name,
test_activity_name, command_line_file):
"""
Args:
adb: ADB interface the tests are using.
device: Device to run the tests.
- test_suite: A specific test suite to run, empty to run all.
+ suite_path_full: Absolute path to a specific test suite to run,
+ empty to run all.
+ Ex: '/foo/bar/base_unittests-debug.apk', for which
+ self.suite_path_full = '/foo/bar/base_unittests-debug.apk'
+ self.suite_path = '/foo/bar/base_unittests-debug'
+ self.suite_basename = 'base_unittests'
+ self.suite_dirname = '/foo/bar'
tool: Name of the Valgrind tool.
test_apk_package_name: Apk package name for tests running in APKs.
test_activity_name: Test activity to invoke for APK tests.
command_line_file: Filename to use to pass arguments to tests.
"""
- TestPackage.__init__(self, adb, device, test_suite, tool)
+ TestPackage.__init__(self, adb, device, suite_path_full, tool)
self._test_apk_package_name = test_apk_package_name
self._test_activity_name = test_activity_name
self._command_line_file = command_line_file
@@ -42,7 +48,7 @@ class TestPackageApk(TestPackage):
def _CreateCommandLineFileOnDevice(self, options):
command_line_file = tempfile.NamedTemporaryFile()
# GTest expects argv[0] to be the executable path.
- command_line_file.write(self.test_suite_basename + ' ' + options)
+ command_line_file.write(self.suite_basename + ' ' + options)
command_line_file.flush()
self.adb.PushIfNeeded(command_line_file.name,
constants.TEST_EXECUTABLE_DIR + '/' +
@@ -87,14 +93,14 @@ class TestPackageApk(TestPackage):
self._test_apk_package_name)
if installed_apk_path:
return not self.adb.CheckMd5Sum(
- self.test_suite_full, installed_apk_path, ignore_paths=True)
+ self.suite_path_full, installed_apk_path, ignore_paths=True)
else:
return True
def _GetTestSuiteBaseName(self):
"""Returns the base name of the test suite."""
# APK test suite names end with '-debug.apk'
- return os.path.basename(self.test_suite).rsplit('-debug', 1)[0]
+ return os.path.basename(self.suite_path).rsplit('-debug', 1)[0]
#override
def ClearApplicationState(self):
@@ -140,6 +146,5 @@ class TestPackageApk(TestPackage):
if self._NeedsInstall():
# Always uninstall the previous one (by activity name); we don't
# know what was embedded in it.
- self.adb.ManagedInstall(self.test_suite_full, False,
+ self.adb.ManagedInstall(self.suite_path_full, False,
package_name=self._test_apk_package_name)
-
« no previous file with comments | « build/android/pylib/gtest/test_package.py ('k') | build/android/pylib/gtest/test_package_exe.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698