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

Unified Diff: build/android/pylib/instrumentation/setup.py

Issue 21008004: Changes argument passing to use options objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes imports, removes intermediate variables 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/instrumentation/setup.py
diff --git a/build/android/pylib/instrumentation/setup.py b/build/android/pylib/instrumentation/setup.py
index 1c09acfd4fc15b3fe39e2ca099d7f57add9b5fde..3b24188fbd5253310500d814ee9039732a8a0794 100644
--- a/build/android/pylib/instrumentation/setup.py
+++ b/build/android/pylib/instrumentation/setup.py
@@ -5,52 +5,31 @@
"""Generates test runner factory and tests for instrumentation tests."""
import logging
-import os
-
-from pylib import android_commands
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.utils import report_results
import test_package
import test_runner
-def Setup(test_apk_path, test_apk_jar_path, annotations, exclude_annotations,
- test_filter, build_type, test_data, save_perf_json,
- screenshot_failures, tool, wait_for_debugger, disable_assertions,
- push_deps, cleanup_test_files):
+def Setup(test_options):
"""Create and return the test runner factory and tests.
Args:
- test_apk_path: Path to the test apk file.
- test_apk_jar_path: Path to the jar associated with the test apk.
- annotations: Annotations for the tests.
- exclude_annotations: Any annotations to exclude from running.
- test_filter: Filter string for tests.
- build_type: 'Release' or 'Debug'.
- test_data: Location of the test data.
- save_perf_json: Whether or not to save the JSON file from UI perf tests.
- screenshot_failures: Take a screenshot for a test failure
- tool: Name of the Valgrind tool.
- wait_for_debugger: blocks until the debugger is connected.
- disable_assertions: Whether to disable java assertions on the device.
- push_deps: If True, push all dependencies to the device.
- cleanup_test_files: Whether or not to cleanup test files on device.
+ test_options: An InstrumentationOptions object.
Returns:
A tuple of (TestRunnerFactory, tests).
"""
- test_pkg = test_package.TestPackage(test_apk_path, test_apk_jar_path)
- tests = test_pkg._GetAllMatchingTests(annotations, exclude_annotations,
- test_filter)
+ test_pkg = test_package.TestPackage(test_options.test_apk_path,
+ test_options.test_apk_jar_path)
+ tests = test_pkg._GetAllMatchingTests(
+ test_options.annotations,
+ test_options.exclude_annotations,
+ test_options.test_filter)
if not tests:
logging.error('No instrumentation tests to run with current args.')
def TestRunnerFactory(device, shard_index):
- return test_runner.TestRunner(
- build_type, test_data, save_perf_json, screenshot_failures,
- tool, wait_for_debugger, disable_assertions, push_deps,
- cleanup_test_files, device, shard_index, test_pkg, [])
+ return test_runner.TestRunner(test_options, device, shard_index,
+ test_pkg, [])
return (TestRunnerFactory, tests)
« no previous file with comments | « build/android/pylib/host_driven/run_python_tests.py ('k') | build/android/pylib/instrumentation/test_options.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698