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

Side by Side Diff: build/android/pylib/local/device/local_device_gtest_run.py

Issue 2752493002: [android] Add support for passing command-line flags directly. (Closed)
Patch Set: Ensure command_line_flags is always present in the Namespace. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import collections 5 import collections
6 import itertools 6 import itertools
7 import logging 7 import logging
8 import os 8 import os
9 import posixpath 9 import posixpath
10 import time 10 import time
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 # Run the test. 381 # Run the test.
382 timeout = (self._test_instance.shard_timeout 382 timeout = (self._test_instance.shard_timeout
383 * self.GetTool(device).GetTimeoutScale()) 383 * self.GetTool(device).GetTimeoutScale())
384 if self._test_instance.store_tombstones: 384 if self._test_instance.store_tombstones:
385 tombstones.ClearAllTombstones(device) 385 tombstones.ClearAllTombstones(device)
386 with device_temp_file.DeviceTempFile( 386 with device_temp_file.DeviceTempFile(
387 adb=device.adb, 387 adb=device.adb,
388 dir=self._delegate.ResultsDirectory(device), 388 dir=self._delegate.ResultsDirectory(device),
389 suffix='.xml') as device_tmp_results_file: 389 suffix='.xml') as device_tmp_results_file:
390 390
391 flags = self._test_instance.test_arguments or '' 391 flags = list(self._test_instance.flags)
392 if self._test_instance.enable_xml_result_parsing: 392 if self._test_instance.enable_xml_result_parsing:
393 flags += ' --gtest_output=xml:%s' % device_tmp_results_file.name 393 flags.append('--gtest_output=xml:%s' % device_tmp_results_file.name)
394 if self._test_instance.gtest_also_run_disabled_tests: 394
395 flags += ' --gtest_also_run_disabled_tests' 395 logging.info('flags:')
396 for f in flags:
397 logging.info(' %s', f)
396 398
397 with contextlib_ext.Optional( 399 with contextlib_ext.Optional(
398 trace_event.trace(str(test)), 400 trace_event.trace(str(test)),
399 self._env.trace_output): 401 self._env.trace_output):
400 output = self._delegate.Run( 402 output = self._delegate.Run(
401 test, device, flags=flags, 403 test, device, flags=' '.join(flags),
402 timeout=timeout, retries=0) 404 timeout=timeout, retries=0)
403 405
404 if self._test_instance.enable_xml_result_parsing: 406 if self._test_instance.enable_xml_result_parsing:
405 gtest_xml = device.ReadFile( 407 gtest_xml = device.ReadFile(
406 device_tmp_results_file.name, 408 device_tmp_results_file.name,
407 as_root=True) 409 as_root=True)
408 410
409 for s in self._servers[str(device)]: 411 for s in self._servers[str(device)]:
410 s.Reset() 412 s.Reset()
411 if self._test_instance.app_files: 413 if self._test_instance.app_files:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 @local_device_environment.handle_shard_failures 457 @local_device_environment.handle_shard_failures
456 @trace_event.traced 458 @trace_event.traced
457 def individual_device_tear_down(dev): 459 def individual_device_tear_down(dev):
458 for s in self._servers.get(str(dev), []): 460 for s in self._servers.get(str(dev), []):
459 s.TearDown() 461 s.TearDown()
460 462
461 tool = self.GetTool(dev) 463 tool = self.GetTool(dev)
462 tool.CleanUpEnvironment() 464 tool.CleanUpEnvironment()
463 465
464 self._env.parallel_devices.pMap(individual_device_tear_down) 466 self._env.parallel_devices.pMap(individual_device_tear_down)
OLDNEW
« no previous file with comments | « build/android/pylib/instrumentation/instrumentation_test_instance_test.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698