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

Side by Side Diff: build/android/test_runner.py

Issue 2688913003: Add shared preference file modification option to instrumentation test runner (Closed)
Patch Set: Change to take a path to a file instead of hex-encoded data Created 3 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Runs all types of tests from one unified interface.""" 7 """Runs all types of tests from one unified interface."""
8 8
9 import argparse 9 import argparse
10 import collections 10 import collections
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 'death/testing to kill the process, off to stop ' 393 'death/testing to kill the process, off to stop '
394 'checking, flash to flash only. Default testing.') 394 'checking, flash to flash only. Default testing.')
395 group.add_argument('--regenerate-goldens', dest='regenerate_goldens', 395 group.add_argument('--regenerate-goldens', dest='regenerate_goldens',
396 action='store_true', 396 action='store_true',
397 help='Causes the render tests to not fail when a check' 397 help='Causes the render tests to not fail when a check'
398 'fails or the golden image is missing but to render' 398 'fails or the golden image is missing but to render'
399 'the view and carry on.') 399 'the view and carry on.')
400 group.add_argument('--store-tombstones', dest='store_tombstones', 400 group.add_argument('--store-tombstones', dest='store_tombstones',
401 action='store_true', 401 action='store_true',
402 help='Add tombstones in results if crash.') 402 help='Add tombstones in results if crash.')
403 group.add_argument('--shared-prefs-file', dest='shared_prefs_file',
jbudorick 2017/02/15 22:38:42 nit: add type=os.path.realpath.
bsheedy 2017/02/15 22:54:52 I initially did this, but then it appends the curr
jbudorick 2017/02/16 02:57:09 Yeah, that's fine. I think you're more likely to r
bsheedy 2017/02/16 18:04:50 Done.
404 help='The path from the source root directory '
405 'to a file containing JSON list of shared '
406 'preference files to edit and how to do '
407 'so. Example list: '
408 '[{'
jbudorick 2017/02/15 22:38:42 nit: how does this appear in the actual --help tex
bsheedy 2017/02/15 22:54:52 It doesn't look nicely formatted when --help is us
jbudorick 2017/02/16 02:57:08 eh, I think it's ok for now.
bsheedy 2017/02/16 18:04:50 Done.
409 ' "package": "com.package.example",'
410 ' "filename": "ExampleSettings.xml",'
411 ' "set": {'
412 ' "boolean_key_in_xml": true,'
413 ' "string_key_in_xml": "string_value"'
414 ' },'
415 ' "remove": ['
416 ' "key_in_xml_to_remove"'
417 ' ]'
418 '}]')
403 419
404 AddCommonOptions(parser) 420 AddCommonOptions(parser)
405 AddDeviceOptions(parser) 421 AddDeviceOptions(parser)
406 422
407 423
408 def AddJUnitTestOptions(parser): 424 def AddJUnitTestOptions(parser):
409 """Adds junit test options to |parser|.""" 425 """Adds junit test options to |parser|."""
410 426
411 group = parser.add_argument_group('JUnit Test Options') 427 group = parser.add_argument_group('JUnit Test Options')
412 group.add_argument( 428 group.add_argument(
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 if e.is_infra_error: 853 if e.is_infra_error:
838 return constants.INFRA_EXIT_CODE 854 return constants.INFRA_EXIT_CODE
839 return constants.ERROR_EXIT_CODE 855 return constants.ERROR_EXIT_CODE
840 except: # pylint: disable=W0702 856 except: # pylint: disable=W0702
841 logging.exception('Unrecognized error occurred.') 857 logging.exception('Unrecognized error occurred.')
842 return constants.ERROR_EXIT_CODE 858 return constants.ERROR_EXIT_CODE
843 859
844 860
845 if __name__ == '__main__': 861 if __name__ == '__main__':
846 sys.exit(main()) 862 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698