| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """This module runs a suite of Auto Update tests. | 7 """This module runs a suite of Auto Update tests. |
| 8 | 8 |
| 9 The tests can be run on either a virtual machine or actual device depending | 9 The tests can be run on either a virtual machine or actual device depending |
| 10 on parameters given. Specific tests can be run by invoking --test_prefix. | 10 on parameters given. Specific tests can be run by invoking --test_prefix. |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 """Runs the tests given by the options and test_class in parallel.""" | 904 """Runs the tests given by the options and test_class in parallel.""" |
| 905 threads = [] | 905 threads = [] |
| 906 args = [] | 906 args = [] |
| 907 test_suite = _PrepareTestSuite(parser, options, test_class) | 907 test_suite = _PrepareTestSuite(parser, options, test_class) |
| 908 for test in test_suite: | 908 for test in test_suite: |
| 909 test_name = test.id() | 909 test_name = test.id() |
| 910 test_case = unittest.TestLoader().loadTestsFromName(test_name) | 910 test_case = unittest.TestLoader().loadTestsFromName(test_name) |
| 911 threads.append(unittest.TextTestRunner().run) | 911 threads.append(unittest.TextTestRunner().run) |
| 912 args.append(test_case) | 912 args.append(test_case) |
| 913 | 913 |
| 914 results = _RunParallelJobs(options.jobs, threads, args, print_status=False) | 914 # TODO(sosa): Set back to options.jobs once parallel generation is |
| 915 # no longer flaky. |
| 916 results = _RunParallelJobs(1, threads, args, print_status=False) |
| 915 for test_result in results: | 917 for test_result in results: |
| 916 if not test_result.wasSuccessful(): | 918 if not test_result.wasSuccessful(): |
| 917 Die('Test harness was not successful') | 919 Die('Test harness was not successful') |
| 918 | 920 |
| 919 | 921 |
| 920 def main(): | 922 def main(): |
| 921 parser = optparse.OptionParser() | 923 parser = optparse.OptionParser() |
| 922 parser.add_option('-b', '--base_image', | 924 parser.add_option('-b', '--base_image', |
| 923 help='path to the base image.') | 925 help='path to the base image.') |
| 924 parser.add_option('-r', '--board', | 926 parser.add_option('-r', '--board', |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 else: | 970 else: |
| 969 dev_server_cache = None | 971 dev_server_cache = None |
| 970 test_suite = _PrepareTestSuite(parser, options, test_class) | 972 test_suite = _PrepareTestSuite(parser, options, test_class) |
| 971 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) | 973 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) |
| 972 if not test_result.wasSuccessful(): | 974 if not test_result.wasSuccessful(): |
| 973 Die('Test harness was not successful.') | 975 Die('Test harness was not successful.') |
| 974 | 976 |
| 975 | 977 |
| 976 if __name__ == '__main__': | 978 if __name__ == '__main__': |
| 977 main() | 979 main() |
| OLD | NEW |