OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
3 # Copyright (C) 2011 Apple Inc. All rights reserved. | 3 # Copyright (C) 2011 Apple Inc. All rights reserved. |
4 # | 4 # |
5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
7 # met: | 7 # met: |
8 # | 8 # |
9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 default=0, | 322 default=0, |
323 help="Set the maximum number of locked shards"), | 323 help="Set the maximum number of locked shards"), |
324 optparse.make_option( | 324 optparse.make_option( |
325 "--nocheck-sys-deps", | 325 "--nocheck-sys-deps", |
326 action="store_true", | 326 action="store_true", |
327 default=False, | 327 default=False, |
328 help="Don't check the system dependencies (themes)"), | 328 help="Don't check the system dependencies (themes)"), |
329 optparse.make_option( | 329 optparse.make_option( |
330 "--order", | 330 "--order", |
331 action="store", | 331 action="store", |
332 # TODO(jeffcarp): platforms are moving to random-order by defaul
t independently. | 332 default="random", |
333 # See _set_up_derived_options below and crbug.com/601332. | |
334 default=("default"), | |
335 help=("Determine the order in which the test cases will be run.
" | 333 help=("Determine the order in which the test cases will be run.
" |
336 "'none' == use the order in which the tests were listed " | 334 "'none' == use the order in which the tests were listed " |
337 "either in arguments or test list, " | 335 "either in arguments or test list, " |
338 "'random' == pseudo-random order. Seed can be specified " | 336 "'random' == pseudo-random order (default). Seed can be sp
ecified " |
339 "via --seed, otherwise it will default to the current unix
timestamp " | 337 "via --seed, otherwise it will default to the current unix
timestamp. " |
340 "(default on Mac & Linux). " | 338 "'natural' == use the natural order")), |
341 "'natural' == use the natural order (default on all others
).")), | |
342 optparse.make_option( | 339 optparse.make_option( |
343 "--profile", | 340 "--profile", |
344 action="store_true", | 341 action="store_true", |
345 help="Output per-test profile information."), | 342 help="Output per-test profile information."), |
346 optparse.make_option( | 343 optparse.make_option( |
347 "--profiler", | 344 "--profiler", |
348 action="store", | 345 action="store", |
349 help="Output per-test profile information, using the specified p
rofiler."), | 346 help="Output per-test profile information, using the specified p
rofiler."), |
350 optparse.make_option( | 347 optparse.make_option( |
351 "--repeat-each", | 348 "--repeat-each", |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 options.total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS'])
+ 1 | 556 options.total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS'])
+ 1 |
560 if not options.shard_index and 'GTEST_SHARD_INDEX' in port.host.environ: | 557 if not options.shard_index and 'GTEST_SHARD_INDEX' in port.host.environ: |
561 options.shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) | 558 options.shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) |
562 if options.shard_index is not None and options.total_shards is not None: | 559 if options.shard_index is not None and options.total_shards is not None: |
563 options.run_part = '%d:%d' % (int(options.shard_index) + 1, | 560 options.run_part = '%d:%d' % (int(options.shard_index) + 1, |
564 int(options.total_shards)) | 561 int(options.total_shards)) |
565 | 562 |
566 if not options.seed: | 563 if not options.seed: |
567 options.seed = port.host.time() | 564 options.seed = port.host.time() |
568 | 565 |
569 # TODO(jeffcarp): This will be removed once all platforms move to random ord
er. | |
570 # This must be here and not in parse_args because host is not instantiated y
et there. | |
571 # See crbug.com/601332. | |
572 if options.order == 'default': | |
573 port_name = port.host.port_factory.get().port_name | |
574 if port_name.startswith(("linux-", "mac-")): | |
575 options.order = 'random' | |
576 else: | |
577 options.order = 'natural' | |
578 | |
579 def _run_tests(port, options, args, printer): | 566 def _run_tests(port, options, args, printer): |
580 _set_up_derived_options(port, options, args) | 567 _set_up_derived_options(port, options, args) |
581 manager = Manager(port, options, printer) | 568 manager = Manager(port, options, printer) |
582 printer.print_config(port.results_directory()) | 569 printer.print_config(port.results_directory()) |
583 return manager.run(args) | 570 return manager.run(args) |
584 | 571 |
585 | 572 |
586 def run(port, options, args, logging_stream, stdout): | 573 def run(port, options, args, logging_stream, stdout): |
587 logger = logging.getLogger() | 574 logger = logging.getLogger() |
588 logger.setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO
) | 575 logger.setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO
) |
(...skipping 26 matching lines...) Expand all Loading... |
615 _log.debug("\t%s", process) | 602 _log.debug("\t%s", process) |
616 | 603 |
617 return run_details | 604 return run_details |
618 | 605 |
619 finally: | 606 finally: |
620 printer.cleanup() | 607 printer.cleanup() |
621 | 608 |
622 if __name__ == '__main__': | 609 if __name__ == '__main__': |
623 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr) | 610 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr) |
624 sys.exit(exit_code) | 611 sys.exit(exit_code) |
OLD | NEW |