OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 '''A test runner for gtest application tests.''' | 6 '''A test runner for gtest application tests.''' |
7 | 7 |
8 import argparse | 8 import argparse |
9 import json | 9 import json |
10 import logging | 10 import logging |
(...skipping 15 matching lines...) Expand all Loading... |
26 help='Print additional logging information.') | 26 help='Print additional logging information.') |
27 parser.add_argument('--repeat-count', default=1, metavar='INT', | 27 parser.add_argument('--repeat-count', default=1, metavar='INT', |
28 action='store', type=int, | 28 action='store', type=int, |
29 help='The number of times to repeat the set of tests.') | 29 help='The number of times to repeat the set of tests.') |
30 parser.add_argument('--write-full-results-to', metavar='FILENAME', | 30 parser.add_argument('--write-full-results-to', metavar='FILENAME', |
31 help='The path to write the JSON list of full results.') | 31 help='The path to write the JSON list of full results.') |
32 parser.add_argument('--test-list-file', metavar='FILENAME', type=file, | 32 parser.add_argument('--test-list-file', metavar='FILENAME', type=file, |
33 default=APPTESTS, help='The file listing tests to run.') | 33 default=APPTESTS, help='The file listing tests to run.') |
34 args = parser.parse_args() | 34 args = parser.parse_args() |
35 | 35 |
36 gtest.set_color() | |
37 logger = logging.getLogger() | 36 logger = logging.getLogger() |
38 logging.basicConfig(stream=sys.stdout, format='%(levelname)s:%(message)s') | 37 logging.basicConfig(stream=sys.stdout, format='%(levelname)s:%(message)s') |
39 logger.setLevel(logging.DEBUG if args.verbose else logging.WARNING) | 38 logger.setLevel(logging.DEBUG if args.verbose else logging.WARNING) |
40 logger.debug('Initialized logging: level=%s' % logger.level) | 39 logger.debug('Initialized logging: level=%s' % logger.level) |
41 | 40 |
42 logger.debug('Test list file: %s', args.test_list_file) | 41 logger.debug('Test list file: %s', args.test_list_file) |
43 config = Config(args.build_dir, is_verbose=args.verbose, | 42 config = Config(args.build_dir, is_verbose=args.verbose, |
44 apk_name='MojoRunnerApptests.apk') | 43 apk_name='MojoRunnerApptests.apk') |
45 execution_globals = {'config': config} | 44 execution_globals = {'config': config} |
46 exec args.test_list_file in execution_globals | 45 exec args.test_list_file in execution_globals |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 trie[path] = value | 138 trie[path] = value |
140 return | 139 return |
141 directory, rest = path.split('.', 1) | 140 directory, rest = path.split('.', 1) |
142 if directory not in trie: | 141 if directory not in trie: |
143 trie[directory] = {} | 142 trie[directory] = {} |
144 _AddPathToTrie(trie[directory], rest, value) | 143 _AddPathToTrie(trie[directory], rest, value) |
145 | 144 |
146 | 145 |
147 if __name__ == '__main__': | 146 if __name__ == '__main__': |
148 sys.exit(main()) | 147 sys.exit(main()) |
OLD | NEW |