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 """Convenience script for expect_tests""" | 6 """Convenience script for expect_tests""" |
7 | 7 |
8 assert __name__ == '__main__' | 8 assert __name__ == '__main__' |
9 | 9 |
10 import itertools | 10 import itertools |
(...skipping 28 matching lines...) Expand all Loading... |
39 'infra/libs/buildbot', | 39 'infra/libs/buildbot', |
40 'infra/libs/decorators', | 40 'infra/libs/decorators', |
41 'infra/libs/gitiles', | 41 'infra/libs/gitiles', |
42 'infra/libs/process_invocation', | 42 'infra/libs/process_invocation', |
43 'infra/libs/service_utils', | 43 'infra/libs/service_utils', |
44 'infra/libs/state_machine', | 44 'infra/libs/state_machine', |
45 | 45 |
46 'infra/services/service_manager', | 46 'infra/services/service_manager', |
47 'infra/services/sysmon', | 47 'infra/services/sysmon', |
48 | 48 |
49 # TODO(sergeyberezin): remove this section when infra_libs is removed. | |
50 'infra_libs/event_mon', | |
51 'infra_libs/infra_types', | |
52 'infra_libs/logs', | |
53 'infra_libs/time_functions', | |
54 'infra_libs/ts_mon', | |
55 'infra_libs:infra_libs.test.*', | |
56 | |
57 'packages/infra_libs/infra_libs/event_mon', | 49 'packages/infra_libs/infra_libs/event_mon', |
58 'packages/infra_libs/infra_libs/infra_types', | 50 'packages/infra_libs/infra_libs/infra_types', |
59 'packages/infra_libs/infra_libs/logs', | 51 'packages/infra_libs/infra_libs/logs', |
60 'packages/infra_libs/infra_libs/time_functions', | 52 'packages/infra_libs/infra_libs/time_functions', |
61 'packages/infra_libs/infra_libs/ts_mon', | 53 'packages/infra_libs/infra_libs/ts_mon', |
62 'packages/infra_libs/infra_libs:infra_libs.test.*', | 54 'packages/infra_libs/infra_libs:infra_libs.test.*', |
63 ] | 55 ] |
64 | 56 |
65 | 57 |
66 # Parse command-line arguments | 58 # Parse command-line arguments |
(...skipping 24 matching lines...) Expand all Loading... |
91 if flags: | 83 if flags: |
92 flags.append(arg) | 84 flags.append(arg) |
93 else: | 85 else: |
94 modules.append(arg) | 86 modules.append(arg) |
95 | 87 |
96 # Set up default list of packages/directories if none have been provided. | 88 # Set up default list of packages/directories if none have been provided. |
97 if not modules: | 89 if not modules: |
98 if sys.platform == 'win32': | 90 if sys.platform == 'win32': |
99 modules.extend(WIN_ENABLED_PACKAGES) | 91 modules.extend(WIN_ENABLED_PACKAGES) |
100 else: | 92 else: |
101 modules.extend(['infra', 'infra_libs']) # TODO(pgervais): add 'test/' | 93 modules.extend(['infra']) # TODO(pgervais): add 'test/' |
102 appengine_dir = os.path.join(INFRA_ROOT, 'appengine') | 94 appengine_dir = os.path.join(INFRA_ROOT, 'appengine') |
103 if sys.platform != 'win32' and os.path.isdir(appengine_dir): | 95 if sys.platform != 'win32' and os.path.isdir(appengine_dir): |
104 modules.extend(['appengine_module']) | 96 modules.extend(['appengine_module']) |
105 appengine_dirs = [ | 97 appengine_dirs = [ |
106 os.path.join('appengine', d) | 98 os.path.join('appengine', d) |
107 for d in os.listdir(appengine_dir) | 99 for d in os.listdir(appengine_dir) |
108 ] | 100 ] |
109 # Use relative paths to shorten the command-line | 101 # Use relative paths to shorten the command-line |
110 modules.extend(itertools.chain( | 102 modules.extend(itertools.chain( |
111 [d for d in appengine_dirs if os.path.isfile(os.path.join(d, | 103 [d for d in appengine_dirs if os.path.isfile(os.path.join(d, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 145 |
154 if exit_code: | 146 if exit_code: |
155 print 'Tests failed in modules:\n %s' % '\n '.join(failed_modules) | 147 print 'Tests failed in modules:\n %s' % '\n '.join(failed_modules) |
156 if '--html-report' not in flags: | 148 if '--html-report' not in flags: |
157 print '\nFor detailed coverage report and per-line branch coverage,' | 149 print '\nFor detailed coverage report and per-line branch coverage,' |
158 print 'rerun with --html-report <dir>' | 150 print 'rerun with --html-report <dir>' |
159 else: | 151 else: |
160 print 'All tests passed.' | 152 print 'All tests passed.' |
161 | 153 |
162 sys.exit(exit_code) | 154 sys.exit(exit_code) |
OLD | NEW |