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

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

Issue 21008004: Changes argument passing to use options objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: build/android/pylib/gtest/test_runner.py
diff --git a/build/android/pylib/gtest/test_runner.py b/build/android/pylib/gtest/test_runner.py
index da422c38ee083cbf3a78bc4ee4edd1ebf70deec2..82262cdcbdf27110398d8131df5312f03ed63f23 100644
--- a/build/android/pylib/gtest/test_runner.py
+++ b/build/android/pylib/gtest/test_runner.py
@@ -11,7 +11,6 @@ from pylib import constants
from pylib import pexpect
from pylib.base import base_test_result
from pylib.base import base_test_runner
-from pylib.utils import run_tests_helper
import test_package_apk
import test_package_exe
@@ -27,28 +26,26 @@ def _TestSuiteRequiresMockTestServer(suite_basename):
class TestRunner(base_test_runner.BaseTestRunner):
- def __init__(self, device, suite_name, test_arguments, timeout,
- cleanup_test_files, tool_name, build_type,
- push_deps, test_apk_package_name=None,
- test_activity_name=None, command_line_file=None):
+ def __init__(self, test_options, suite_path, device,
+ test_apk_package_name=None, test_activity_name=None,
+ command_line_file=None):
"""Single test suite attached to a single device.
Args:
+ test_options: A GTestOptions object containing the set of options
+ relevant to running instrumentation tests.
+ suite_path: The absolute path to a suite apk or executable file.
device: Device to run the tests.
- suite_name: A specific test suite to run, empty to run all.
- test_arguments: Additional arguments to pass to the test binary.
- timeout: Timeout for each test.
- cleanup_test_files: Whether or not to cleanup test files on device.
- tool_name: Name of the Valgrind tool.
- build_type: 'Release' or 'Debug'.
- push_deps: If True, push all dependencies to the device.
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.
"""
- super(TestRunner, self).__init__(device, tool_name, build_type, push_deps,
- cleanup_test_files)
- self._test_arguments = test_arguments
+ super(TestRunner, self).__init__(device, test_options.tool,
+ test_options.build_type,
+ test_options.push_deps,
+ test_options.cleanup_test_files)
+ self._test_arguments = test_options.test_arguments
+ timeout = test_options.timeout
if timeout == 0:
timeout = 60
# On a VM (e.g. chromium buildbots), this timeout is way too small.
@@ -56,12 +53,12 @@ class TestRunner(base_test_runner.BaseTestRunner):
timeout = timeout * 2
self.timeout = timeout * self.tool.GetTimeoutScale()
- logging.warning('Test suite: ' + str(suite_name))
- if os.path.splitext(suite_name)[1] == '.apk':
+ logging.warning('Test suite: ' + str(suite_path))
+ if os.path.splitext(suite_path)[1] == '.apk':
self.test_package = test_package_apk.TestPackageApk(
self.adb,
device,
- suite_name,
+ suite_path,
self.tool,
test_apk_package_name,
test_activity_name,
@@ -69,12 +66,12 @@ class TestRunner(base_test_runner.BaseTestRunner):
else:
# Put a copy into the android out/target directory, to allow stack trace
# generation.
- symbols_dir = os.path.join(constants.DIR_SOURCE_ROOT, 'out', build_type,
- 'lib.target')
+ symbols_dir = os.path.join(constants.DIR_SOURCE_ROOT, 'out',
+ test_options.build_type, 'lib.target')
self.test_package = test_package_exe.TestPackageExecutable(
self.adb,
device,
- suite_name,
+ suite_path,
self.tool,
symbols_dir)

Powered by Google App Engine
This is Rietveld 408576698