| 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/ | |
| 387 help=("Seed to use for random test order (default: %default). " | 386 help=("Seed to use for random test order (default: %default). " |
| 388 "Only applicable in combination with --order=random.")), | 387 "Only applicable in combination with --order=random.")), |
| 389 optparse.make_option( | 388 optparse.make_option( |
| 390 "--skipped", | 389 "--skipped", |
| 391 action="store", | 390 action="store", |
| 392 default=None, | 391 default=None, |
| 393 help=("control how tests marked SKIP are run. " | 392 help=("control how tests marked SKIP are run. " |
| 394 "'default' == Skip tests unless explicitly listed on the c
ommand line, " | 393 "'default' == Skip tests unless explicitly listed on the c
ommand line, " |
| 395 "'ignore' == Run them anyway, " | 394 "'ignore' == Run them anyway, " |
| 396 "'only' == only run the SKIP tests, " | 395 "'only' == only run the SKIP tests, " |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 options.skipped = 'always' | 539 options.skipped = 'always' |
| 541 | 540 |
| 542 if not options.skipped: | 541 if not options.skipped: |
| 543 options.skipped = 'default' | 542 options.skipped = 'default' |
| 544 | 543 |
| 545 if 'GTEST_SHARD_INDEX' in port.host.environ and 'GTEST_TOTAL_SHARDS' in port
.host.environ: | 544 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 | 545 shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) + 1 |
| 547 total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) + 1 | 546 total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) + 1 |
| 548 options.run_part = '{0}:{1}'.format(shard_index, total_shards) | 547 options.run_part = '{0}:{1}'.format(shard_index, total_shards) |
| 549 | 548 |
| 549 if not options.seed: |
| 550 options.seed = port.host.time() |
| 550 | 551 |
| 551 def _run_tests(port, options, args, printer): | 552 def _run_tests(port, options, args, printer): |
| 552 _set_up_derived_options(port, options, args) | 553 _set_up_derived_options(port, options, args) |
| 553 manager = Manager(port, options, printer) | 554 manager = Manager(port, options, printer) |
| 554 printer.print_config(port.results_directory()) | 555 printer.print_config(port.results_directory()) |
| 555 return manager.run(args) | 556 return manager.run(args) |
| 556 | 557 |
| 557 | 558 |
| 558 def run(port, options, args, logging_stream, stdout): | 559 def run(port, options, args, logging_stream, stdout): |
| 559 logger = logging.getLogger() | 560 logger = logging.getLogger() |
| (...skipping 27 matching lines...) Expand all Loading... |
| 587 _log.debug("\t%s", process) | 588 _log.debug("\t%s", process) |
| 588 | 589 |
| 589 return run_details | 590 return run_details |
| 590 | 591 |
| 591 finally: | 592 finally: |
| 592 printer.cleanup() | 593 printer.cleanup() |
| 593 | 594 |
| 594 if __name__ == '__main__': | 595 if __name__ == '__main__': |
| 595 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr) | 596 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr) |
| 596 sys.exit(exit_code) | 597 sys.exit(exit_code) |
| OLD | NEW |