| OLD | NEW | 
|---|
| 1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- | 
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 """Encapsulates running tests defined in tests.py. | 6 """Encapsulates running tests defined in tests.py. | 
| 7 | 7 | 
| 8 Running this script requires passing --config-path with a path to a config file | 8 Running this script requires passing --config-path with a path to a config file | 
| 9 of the following structure: | 9 of the following structure: | 
| 10 | 10 | 
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 212         del runners[i] | 212         del runners[i] | 
| 213       else: | 213       else: | 
| 214         i += 1 | 214         i += 1 | 
| 215     while len(runners) < max_tests_in_parallel and len(tests_to_run): | 215     while len(runners) < max_tests_in_parallel and len(tests_to_run): | 
| 216       test_name = tests_to_run.pop() | 216       test_name = tests_to_run.pop() | 
| 217       specific_test_cmd = list(general_test_cmd) | 217       specific_test_cmd = list(general_test_cmd) | 
| 218       specific_test_cmd[test_name_idx] = test_name | 218       specific_test_cmd[test_name_idx] = test_name | 
| 219       runners.append(TestRunner(specific_test_cmd, test_name)) | 219       runners.append(TestRunner(specific_test_cmd, test_name)) | 
| 220     time.sleep(1) | 220     time.sleep(1) | 
| 221   failed_tests = [(name, log) for (name, passed, log) in results if not passed] | 221   failed_tests = [(name, log) for (name, passed, log) in results if not passed] | 
| 222   logger.info("%d failed tests out of %d", len(failed_tests), len(results)) | 222   logger.info("%d failed tests out of %d, failing tests: %s", | 
| 223   logger.info("Failing tests: %s", [name for (name, _) in failed_tests]) | 223               len(failed_tests), len(results), | 
|  | 224               [name for (name, _) in failed_tests]) | 
| 224   logger.debug("Logs of failing tests: %s", failed_tests) | 225   logger.debug("Logs of failing tests: %s", failed_tests) | 
| 225 | 226 | 
| 226 | 227 | 
| 227 def main(): | 228 def main(): | 
| 228   parser = argparse.ArgumentParser() | 229   parser = argparse.ArgumentParser() | 
| 229   parser.add_argument("config_path", metavar="N", | 230   parser.add_argument("config_path", metavar="N", | 
| 230                       help="Path to the config.ini file.") | 231                       help="Path to the config.ini file.") | 
| 231   args = parser.parse_args() | 232   args = parser.parse_args() | 
| 232   run_tests(args.config_path) | 233   run_tests(args.config_path) | 
| 233 | 234 | 
| 234 | 235 | 
| 235 if __name__ == "__main__": | 236 if __name__ == "__main__": | 
| 236   main() | 237   main() | 
| OLD | NEW | 
|---|