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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 test_cases = filter(None, f.read().splitlines()) | 700 test_cases = filter(None, f.read().splitlines()) |
701 else: | 701 else: |
702 test_cases = get_test_cases( | 702 test_cases = get_test_cases( |
703 executable, | 703 executable, |
704 options.whitelist, | 704 options.whitelist, |
705 options.blacklist, | 705 options.blacklist, |
706 options.index, | 706 options.index, |
707 options.shards) | 707 options.shards) |
708 | 708 |
709 if not test_cases: | 709 if not test_cases: |
710 return 0 | 710 # If test_cases is None then there was a problem generating the tests to |
| 711 # run, so this should be considered a failure. |
| 712 return int(test_cases is None) |
711 | 713 |
712 if options.no_dump: | 714 if options.no_dump: |
713 result_file = None | 715 result_file = None |
714 else: | 716 else: |
715 if options.result: | 717 if options.result: |
716 result_file = options.result | 718 result_file = options.result |
717 else: | 719 else: |
718 result_file = '%s.run_test_cases' % executable | 720 result_file = '%s.run_test_cases' % executable |
719 | 721 |
720 return run_test_cases( | 722 return run_test_cases( |
721 executable, | 723 executable, |
722 test_cases, | 724 test_cases, |
723 options.jobs, | 725 options.jobs, |
724 options.timeout, | 726 options.timeout, |
725 result_file) | 727 result_file) |
726 | 728 |
727 | 729 |
728 if __name__ == '__main__': | 730 if __name__ == '__main__': |
729 sys.exit(main(sys.argv[1:])) | 731 sys.exit(main(sys.argv[1:])) |
OLD | NEW |