| 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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 results = _RunParallelJobs(options.jobs, threads, args, print_status=False) |
| 915 if not (test_result.wasSuccessful() for test_result in results): | 915 for test_result in results: |
| 916 Die('Test harness was not successful') | 916 if not test_result.wasSuccessful(): |
| 917 Die('Test harness was not successful') |
| 917 | 918 |
| 918 | 919 |
| 919 def main(): | 920 def main(): |
| 920 parser = optparse.OptionParser() | 921 parser = optparse.OptionParser() |
| 921 parser.add_option('-b', '--base_image', | 922 parser.add_option('-b', '--base_image', |
| 922 help='path to the base image.') | 923 help='path to the base image.') |
| 923 parser.add_option('-r', '--board', | 924 parser.add_option('-r', '--board', |
| 924 help='board for the images.') | 925 help='board for the images.') |
| 925 parser.add_option('--no_delta', action='store_false', default=True, | 926 parser.add_option('--no_delta', action='store_false', default=True, |
| 926 dest='delta', | 927 dest='delta', |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 else: | 968 else: |
| 968 dev_server_cache = None | 969 dev_server_cache = None |
| 969 test_suite = _PrepareTestSuite(parser, options, test_class) | 970 test_suite = _PrepareTestSuite(parser, options, test_class) |
| 970 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) | 971 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) |
| 971 if not test_result.wasSuccessful(): | 972 if not test_result.wasSuccessful(): |
| 972 Die('Test harness was not successful.') | 973 Die('Test harness was not successful.') |
| 973 | 974 |
| 974 | 975 |
| 975 if __name__ == '__main__': | 976 if __name__ == '__main__': |
| 976 main() | 977 main() |
| OLD | NEW |