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

Unified Diff: scripts/slave/recipe_modules/chromium/steps.py

Issue 873403002: Add support for cc_perftests and other non-telemetry gtest based tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Use template string. Created 5 years, 10 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: scripts/slave/recipe_modules/chromium/steps.py
diff --git a/scripts/slave/recipe_modules/chromium/steps.py b/scripts/slave/recipe_modules/chromium/steps.py
index dabf74409065e474aece531c49a6a5124b8827f0..6443b7b1623f5a95b2b746b4605e9f01a3e34e50 100644
--- a/scripts/slave/recipe_modules/chromium/steps.py
+++ b/scripts/slave/recipe_modules/chromium/steps.py
@@ -103,11 +103,12 @@ class ScriptTest(Test): # pylint: disable=W0232
All new tests are strongly encouraged to use this infrastructure.
"""
- def __init__(self, name, script, all_compile_targets):
+ def __init__(self, name, script, all_compile_targets, script_args=None):
super(ScriptTest, self).__init__()
self._name = name
self._script = script
self._all_compile_targets = all_compile_targets
+ self._script_args = script_args
@property
def name(self):
@@ -115,7 +116,12 @@ class ScriptTest(Test): # pylint: disable=W0232
def compile_targets(self, api):
try:
- return self._all_compile_targets[self._script]
+ target_name = self._name
Paweł Hajdan Jr. 2015/02/11 08:24:03 This is not target name, but test/step name. Real
shatch 2015/02/12 20:46:32 Ok, checked for script args and take the target na
+ if api.chromium.c.TARGET_PLATFORM == 'android':
+ target_name += '_apk'
Paweł Hajdan Jr. 2015/02/11 08:24:03 Similarly, this logic does not belong here. Just r
shatch 2015/02/12 20:46:32 Made a change in the other CL to add the _apk.
+
+ return [string.Template(s).safe_substitute({'name': target_name})
Paweł Hajdan Jr. 2015/02/11 08:24:03 Did you run this locally? I'd expect a NameError f
shatch 2015/02/12 20:46:32 Oops, not sure how I lost that.
+ for s in self._all_compile_targets[self._script]]
except KeyError:
# Not all scripts will have test data inside recipes,
# so return a default value.
@@ -139,6 +145,9 @@ class ScriptTest(Test): # pylint: disable=W0232
])
try:
+ script_args = []
+ if self._script_args:
+ script_args = ['--args', api.json.input(self._script_args)]
api.python(
name,
# Enforce that all scripts are in the specified directory
@@ -146,6 +155,7 @@ class ScriptTest(Test): # pylint: disable=W0232
api.path['checkout'].join(
'testing', 'scripts', api.path.basename(self._script)),
args=(api.chromium.get_common_args_for_scripts() +
+ script_args +
['run', '--output', api.json.output()] +
run_args),
step_test_data=lambda: api.json.test_api.output(
@@ -324,7 +334,8 @@ def generate_script(api, mastername, buildername, test_spec,
yield ScriptTest(
str(script_spec['name']),
script_spec['script'],
- scripts_compile_targets)
+ scripts_compile_targets,
+ script_spec.get('args', []))
class DynamicPerfTests(Test):

Powered by Google App Engine
This is Rietveld 408576698