OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from slave import recipe_api | 5 from slave import recipe_api |
6 | 6 |
7 class AndroidApi(recipe_api.RecipeApi): | 7 class AndroidApi(recipe_api.RecipeApi): |
8 def __init__(self, **kwargs): | 8 def __init__(self, **kwargs): |
9 super(AndroidApi, self).__init__(**kwargs) | 9 super(AndroidApi, self).__init__(**kwargs) |
10 self._env = dict() | 10 self._env = dict() |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 yield self.m.step( | 100 yield self.m.step( |
101 'get_internal_names', | 101 'get_internal_names', |
102 [self.c.internal_dir('build', 'dump_internal_names.py'), | 102 [self.c.internal_dir('build', 'dump_internal_names.py'), |
103 '--output-json', self.m.json.output()] | 103 '--output-json', self.m.json.output()] |
104 ) | 104 ) |
105 | 105 |
106 self._internal_names = self.m.step_history.last_step().json.output | 106 self._internal_names = self.m.step_history.last_step().json.output |
107 | 107 |
108 def envsetup(self): | 108 def envsetup(self): |
109 envsetup_cmd = [self.m.path.checkout('build', 'android', 'envsetup.sh')] | 109 envsetup_cmd = [self.m.path.checkout('build', 'android', 'envsetup.sh')] |
110 if self.target_arch: | |
111 envsetup_cmd += ['--target-arch=%s' % self.target_arch] | |
112 | 110 |
113 cmd = ([self.m.path.build('scripts', 'slave', 'env_dump.py'), | 111 cmd = ([self.m.path.build('scripts', 'slave', 'env_dump.py'), |
114 '--output-json', self.m.json.output()] + envsetup_cmd) | 112 '--output-json', self.m.json.output()] + envsetup_cmd) |
115 | 113 |
116 def update_self_env(step_result): | 114 def update_self_env(step_result): |
117 env_diff = step_result.json.output | 115 env_diff = step_result.json.output |
118 for key, value in env_diff.iteritems(): | 116 for key, value in env_diff.iteritems(): |
119 if key.startswith('GYP_'): | 117 if key.startswith('GYP_'): |
120 continue | 118 continue |
121 else: | 119 else: |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 yield self.m.step( | 312 yield self.m.step( |
315 'stack_tool_for_tombstones', | 313 'stack_tool_for_tombstones', |
316 [self.m.path.checkout('build', 'android', 'tombstones.py'), | 314 [self.m.path.checkout('build', 'android', 'tombstones.py'), |
317 '-a', '-s', '-w'], always_run=True, env=self.get_env()) | 315 '-a', '-s', '-w'], always_run=True, env=self.get_env()) |
318 if self.c.asan_symbolize: | 316 if self.c.asan_symbolize: |
319 yield self.m.step( | 317 yield self.m.step( |
320 'stack_tool_for_asan', | 318 'stack_tool_for_asan', |
321 [self.m.path.checkout('build', 'android', 'asan_symbolize.py'), | 319 [self.m.path.checkout('build', 'android', 'asan_symbolize.py'), |
322 '-l', log_file], always_run=True, env=self.get_env()) | 320 '-l', log_file], always_run=True, env=self.get_env()) |
323 | 321 |
324 @property | |
325 def target_arch(self): | |
326 """Convert from recipe arch to android arch.""" | |
327 return { | |
328 'intel': 'x86', | |
329 'arm': 'arm', | |
330 'mips': 'mips', | |
331 }.get(self.m.chromium.c.TARGET_ARCH, '') | |
332 | |
333 def test_report(self): | 322 def test_report(self): |
334 return self.m.python.inline( | 323 return self.m.python.inline( |
335 'test_report', | 324 'test_report', |
336 """ | 325 """ |
337 import glob, os, sys | 326 import glob, os, sys |
338 for report in glob.glob(sys.argv[1]): | 327 for report in glob.glob(sys.argv[1]): |
339 with open(report, 'r') as f: | 328 with open(report, 'r') as f: |
340 for l in f.readlines(): | 329 for l in f.readlines(): |
341 print l | 330 print l |
342 os.remove(report) | 331 os.remove(report) |
(...skipping 18 matching lines...) Expand all Loading... |
361 | 350 |
362 def common_tests_setup_steps(self): | 351 def common_tests_setup_steps(self): |
363 yield self.spawn_logcat_monitor() | 352 yield self.spawn_logcat_monitor() |
364 yield self.detect_and_setup_devices() | 353 yield self.detect_and_setup_devices() |
365 | 354 |
366 def common_tests_final_steps(self): | 355 def common_tests_final_steps(self): |
367 yield self.logcat_dump() | 356 yield self.logcat_dump() |
368 yield self.stack_tool_steps() | 357 yield self.stack_tool_steps() |
369 yield self.test_report() | 358 yield self.test_report() |
370 yield self.cleanup_build() | 359 yield self.cleanup_build() |
OLD | NEW |