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 # This a simple script to make building/testing Mojo components easier. | 6 # This a simple script to make building/testing Mojo components easier. |
7 | 7 |
8 import argparse | 8 import argparse |
9 from copy import deepcopy | 9 from copy import deepcopy |
10 import os | 10 import os |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 | 189 |
190 def pytest(config): | 190 def pytest(config): |
191 return _run_tests(config, ['python']) | 191 return _run_tests(config, ['python']) |
192 | 192 |
193 | 193 |
194 def darttest(config): | 194 def darttest(config): |
195 return _run_tests(config, ['dart']) | 195 return _run_tests(config, ['dart']) |
196 | 196 |
197 | 197 |
| 198 def nacltest(config): |
| 199 return _run_tests(config, ['nacl']) |
| 200 |
| 201 |
198 def main(): | 202 def main(): |
199 os.chdir(Paths().src_root) | 203 os.chdir(Paths().src_root) |
200 | 204 |
201 parser = argparse.ArgumentParser(description='A script to make building' | 205 parser = argparse.ArgumentParser(description='A script to make building' |
202 '/testing Mojo components easier.') | 206 '/testing Mojo components easier.') |
203 | 207 |
204 parent_parser = argparse.ArgumentParser(add_help=False) | 208 parent_parser = argparse.ArgumentParser(add_help=False) |
205 parent_parser.add_argument('--asan', help='Use Address Sanitizer', | 209 parent_parser.add_argument('--asan', help='Use Address Sanitizer', |
206 action='store_true') | 210 action='store_true') |
207 | 211 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 perftest_parser.set_defaults(func=perftest) | 280 perftest_parser.set_defaults(func=perftest) |
277 | 281 |
278 pytest_parser = subparsers.add_parser('pytest', parents=[parent_parser], | 282 pytest_parser = subparsers.add_parser('pytest', parents=[parent_parser], |
279 help='Run Python unit tests (does not build).') | 283 help='Run Python unit tests (does not build).') |
280 pytest_parser.set_defaults(func=pytest) | 284 pytest_parser.set_defaults(func=pytest) |
281 | 285 |
282 darttest_parser = subparsers.add_parser('darttest', parents=[parent_parser], | 286 darttest_parser = subparsers.add_parser('darttest', parents=[parent_parser], |
283 help='Run Dart unit tests (does not build).') | 287 help='Run Dart unit tests (does not build).') |
284 darttest_parser.set_defaults(func=darttest) | 288 darttest_parser.set_defaults(func=darttest) |
285 | 289 |
| 290 nacltest_parser = subparsers.add_parser('nacltest', parents=[parent_parser], |
| 291 help='Run NaCl unit tests (does not build).') |
| 292 nacltest_parser.set_defaults(func=nacltest) |
| 293 |
286 args = parser.parse_args() | 294 args = parser.parse_args() |
287 config = _args_to_config(args) | 295 config = _args_to_config(args) |
288 return args.func(config) | 296 return args.func(config) |
289 | 297 |
290 | 298 |
291 if __name__ == '__main__': | 299 if __name__ == '__main__': |
292 sys.exit(main()) | 300 sys.exit(main()) |
OLD | NEW |