| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Runs each test cases as a single shard, single process execution. | 6 """Runs each test cases as a single shard, single process execution. |
| 7 | 7 |
| 8 Similar to sharding_supervisor.py but finer grained. Runs multiple instances in | 8 Similar to sharding_supervisor.py but finer grained. Runs multiple instances in |
| 9 parallel. | 9 parallel. |
| 10 """ | 10 """ |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 print '%s is flaky (tried %d times)' % (test_case, len(items)) | 547 print '%s is flaky (tried %d times)' % (test_case, len(items)) |
| 548 | 548 |
| 549 print 'Success: %4d %5.2f%%' % (len(success), len(success) * 100. / total) | 549 print 'Success: %4d %5.2f%%' % (len(success), len(success) * 100. / total) |
| 550 print 'Flaky: %4d %5.2f%%' % (len(flaky), len(flaky) * 100. / total) | 550 print 'Flaky: %4d %5.2f%%' % (len(flaky), len(flaky) * 100. / total) |
| 551 print 'Fail: %4d %5.2f%%' % (len(fail), len(fail) * 100. / total) | 551 print 'Fail: %4d %5.2f%%' % (len(fail), len(fail) * 100. / total) |
| 552 print '%.1fs Done running %d tests with %d executions. %.1f test/s' % ( | 552 print '%.1fs Done running %d tests with %d executions. %.1f test/s' % ( |
| 553 duration, | 553 duration, |
| 554 len(results), | 554 len(results), |
| 555 nb_runs, | 555 nb_runs, |
| 556 nb_runs / duration) | 556 nb_runs / duration) |
| 557 return 0 | 557 return int(bool(fail)) |
| 558 | 558 |
| 559 | 559 |
| 560 def main(): | 560 def main(): |
| 561 """CLI frontend to validate arguments.""" | 561 """CLI frontend to validate arguments.""" |
| 562 def as_digit(variable, default): | 562 def as_digit(variable, default): |
| 563 if variable.isdigit(): | 563 if variable.isdigit(): |
| 564 return int(variable) | 564 return int(variable) |
| 565 return default | 565 return default |
| 566 | 566 |
| 567 parser = optparse.OptionParser(usage='%prog <options> [gtest]') | 567 parser = optparse.OptionParser(usage='%prog <options> [gtest]') |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 return run_test_cases( | 652 return run_test_cases( |
| 653 executable, | 653 executable, |
| 654 test_cases, | 654 test_cases, |
| 655 options.jobs, | 655 options.jobs, |
| 656 options.timeout, | 656 options.timeout, |
| 657 options.no_dump) | 657 options.no_dump) |
| 658 | 658 |
| 659 | 659 |
| 660 if __name__ == '__main__': | 660 if __name__ == '__main__': |
| 661 sys.exit(main()) | 661 sys.exit(main()) |
| OLD | NEW |