| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 """Test runner for Mojo application tests. | 6 """Test runner for Mojo application tests. |
| 7 | 7 |
| 8 The file describing the list of tests has to be a valid Python program that sets | 8 The file describing the list of tests has to be a valid Python program that sets |
| 9 a |tests| global variable, containing entries of the following form: | 9 a |tests| global variable, containing entries of the following form: |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 _logger = logging.getLogger() | 47 _logger = logging.getLogger() |
| 48 | 48 |
| 49 | 49 |
| 50 def main(): | 50 def main(): |
| 51 parser = argparse.ArgumentParser(description=_DESCRIPTION) | 51 parser = argparse.ArgumentParser(description=_DESCRIPTION) |
| 52 parser.add_argument("test_list_file", type=file, | 52 parser.add_argument("test_list_file", type=file, |
| 53 help="a file listing apptests to run") | 53 help="a file listing apptests to run") |
| 54 | 54 |
| 55 # Common shell configuration arguments. | 55 # Common shell configuration arguments. |
| 56 shell_arguments.AddShellArguments(parser) | 56 shell_arguments.add_shell_arguments(parser) |
| 57 script_args, common_shell_args = parser.parse_known_args() | 57 script_args, common_shell_args = parser.parse_known_args() |
| 58 | 58 |
| 59 try: | 59 try: |
| 60 shell, common_shell_args = shell_arguments.ConfigureShell(script_args, | 60 shell, common_shell_args = shell_arguments.configure_shell( |
| 61 common_shell_args) | 61 script_args, common_shell_args) |
| 62 except shell_arguments.ShellConfigurationException as e: | 62 except shell_arguments.ShellConfigurationException as e: |
| 63 print e | 63 print e |
| 64 return 1 | 64 return 1 |
| 65 | 65 |
| 66 target_os = "android" if script_args.android else "linux" | 66 target_os = "android" if script_args.android else "linux" |
| 67 test_list_globals = {"target_os": target_os} | 67 test_list_globals = {"target_os": target_os} |
| 68 exec script_args.test_list_file in test_list_globals | 68 exec script_args.test_list_file in test_list_globals |
| 69 test_list = test_list_globals["tests"] | 69 test_list = test_list_globals["tests"] |
| 70 | 70 |
| 71 succeeded = True | 71 succeeded = True |
| (...skipping 22 matching lines...) Expand all Loading... |
| 94 print "Unrecognized test type in %r" % test_dict | 94 print "Unrecognized test type in %r" % test_dict |
| 95 | 95 |
| 96 print "Succeeded" if apptest_result else "Failed" | 96 print "Succeeded" if apptest_result else "Failed" |
| 97 _logger.info("Completed: %s" % test_name) | 97 _logger.info("Completed: %s" % test_name) |
| 98 if not apptest_result: | 98 if not apptest_result: |
| 99 succeeded = False | 99 succeeded = False |
| 100 return 0 if succeeded else 1 | 100 return 0 if succeeded else 1 |
| 101 | 101 |
| 102 if __name__ == '__main__': | 102 if __name__ == '__main__': |
| 103 sys.exit(main()) | 103 sys.exit(main()) |
| OLD | NEW |