Chromium Code Reviews| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 help="Don't check the system dependencies (themes)"), | 330 help="Don't check the system dependencies (themes)"), |
| 331 optparse.make_option( | 331 optparse.make_option( |
| 332 "--order", | 332 "--order", |
| 333 action="store", | 333 action="store", |
| 334 default="natural", | 334 default="natural", |
| 335 help=("Determine the order in which the test cases will be run. " | 335 help=("Determine the order in which the test cases will be run. " |
| 336 "'none' == use the order in which the tests were listed " | 336 "'none' == use the order in which the tests were listed " |
| 337 "either in arguments or test list, " | 337 "either in arguments or test list, " |
| 338 "'natural' == use the natural order (default), " | 338 "'natural' == use the natural order (default), " |
| 339 "'random' == pseudo-random order. Seed can be specified " | 339 "'random' == pseudo-random order. Seed can be specified " |
| 340 "via --seed, otherwise a default seed will be used.")), | 340 "via --seed, otherwise it will default to the current unix timestamp.")), |
| 341 optparse.make_option( | 341 optparse.make_option( |
| 342 "--profile", | 342 "--profile", |
| 343 action="store_true", | 343 action="store_true", |
| 344 help="Output per-test profile information."), | 344 help="Output per-test profile information."), |
| 345 optparse.make_option( | 345 optparse.make_option( |
| 346 "--profiler", | 346 "--profiler", |
| 347 action="store", | 347 action="store", |
| 348 help="Output per-test profile information, using the specified p rofiler."), | 348 help="Output per-test profile information, using the specified p rofiler."), |
| 349 optparse.make_option( | 349 optparse.make_option( |
| 350 "--repeat-each", | 350 "--repeat-each", |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 376 "--run-part", | 376 "--run-part", |
| 377 help="Run a specified part (n:m), the nth of m parts, of the lay out tests"), | 377 help="Run a specified part (n:m), the nth of m parts, of the lay out tests"), |
| 378 optparse.make_option( | 378 optparse.make_option( |
| 379 "--run-singly", | 379 "--run-singly", |
| 380 action="store_true", | 380 action="store_true", |
| 381 default=False, | 381 default=False, |
| 382 help="DEPRECATED, same as --batch-size=1 --verbose"), | 382 help="DEPRECATED, same as --batch-size=1 --verbose"), |
| 383 optparse.make_option( | 383 optparse.make_option( |
| 384 "--seed", | 384 "--seed", |
| 385 type="int", | 385 type="int", |
| 386 default=4, # http://xkcd.com/221/ | 386 action="store", |
|
Dirk Pranke
2016/10/26 17:24:51
"store" is the default, so you don't need to speci
| |
| 387 help=("Seed to use for random test order (default: %default). " | 387 help=("Seed to use for random test order (default: %default). " |
| 388 "Only applicable in combination with --order=random.")), | 388 "Only applicable in combination with --order=random.")), |
| 389 optparse.make_option( | 389 optparse.make_option( |
| 390 "--skipped", | 390 "--skipped", |
| 391 action="store", | 391 action="store", |
| 392 default=None, | 392 default=None, |
| 393 help=("control how tests marked SKIP are run. " | 393 help=("control how tests marked SKIP are run. " |
| 394 "'default' == Skip tests unless explicitly listed on the c ommand line, " | 394 "'default' == Skip tests unless explicitly listed on the c ommand line, " |
| 395 "'ignore' == Run them anyway, " | 395 "'ignore' == Run them anyway, " |
| 396 "'only' == only run the SKIP tests, " | 396 "'only' == only run the SKIP tests, " |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 540 options.skipped = 'always' | 540 options.skipped = 'always' |
| 541 | 541 |
| 542 if not options.skipped: | 542 if not options.skipped: |
| 543 options.skipped = 'default' | 543 options.skipped = 'default' |
| 544 | 544 |
| 545 if 'GTEST_SHARD_INDEX' in port.host.environ and 'GTEST_TOTAL_SHARDS' in port .host.environ: | 545 if 'GTEST_SHARD_INDEX' in port.host.environ and 'GTEST_TOTAL_SHARDS' in port .host.environ: |
| 546 shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) + 1 | 546 shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) + 1 |
| 547 total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) + 1 | 547 total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) + 1 |
| 548 options.run_part = '{0}:{1}'.format(shard_index, total_shards) | 548 options.run_part = '{0}:{1}'.format(shard_index, total_shards) |
| 549 | 549 |
| 550 if not options.seed: | |
| 551 options.seed = port.host.time.time() | |
| 552 | |
| 550 | 553 |
| 551 def _run_tests(port, options, args, printer): | 554 def _run_tests(port, options, args, printer): |
| 552 _set_up_derived_options(port, options, args) | 555 _set_up_derived_options(port, options, args) |
| 553 manager = Manager(port, options, printer) | 556 manager = Manager(port, options, printer) |
| 554 printer.print_config(port.results_directory()) | 557 printer.print_config(port.results_directory()) |
| 555 return manager.run(args) | 558 return manager.run(args) |
| 556 | 559 |
| 557 | 560 |
| 558 def run(port, options, args, logging_stream, stdout): | 561 def run(port, options, args, logging_stream, stdout): |
| 559 logger = logging.getLogger() | 562 logger = logging.getLogger() |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 587 _log.debug("\t%s", process) | 590 _log.debug("\t%s", process) |
| 588 | 591 |
| 589 return run_details | 592 return run_details |
| 590 | 593 |
| 591 finally: | 594 finally: |
| 592 printer.cleanup() | 595 printer.cleanup() |
| 593 | 596 |
| 594 if __name__ == '__main__': | 597 if __name__ == '__main__': |
| 595 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr) | 598 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr) |
| 596 sys.exit(exit_code) | 599 sys.exit(exit_code) |
| OLD | NEW |