| 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 TODO(vtl|msw): Add a way of specifying data dependencies. | 8 TODO(vtl|msw): Add a way of specifying data dependencies. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 def main(): | 53 def main(): |
| 54 parser = argparse.ArgumentParser( | 54 parser = argparse.ArgumentParser( |
| 55 formatter_class=argparse.RawDescriptionHelpFormatter, | 55 formatter_class=argparse.RawDescriptionHelpFormatter, |
| 56 description=_DESCRIPTION) | 56 description=_DESCRIPTION) |
| 57 parser.add_argument("test_list_file", type=file, | 57 parser.add_argument("test_list_file", type=file, |
| 58 help="a file listing apptests to run") | 58 help="a file listing apptests to run") |
| 59 shell_config.add_shell_arguments(parser) | 59 shell_config.add_shell_arguments(parser) |
| 60 | 60 |
| 61 script_args, shell_args = parser.parse_known_args() | 61 script_args, shell_args = parser.parse_known_args() |
| 62 config = shell_config.get_shell_config(script_args) | |
| 63 | 62 |
| 64 try: | 63 try: |
| 64 config = shell_config.get_shell_config(script_args) |
| 65 shell, common_shell_args = shell_arguments.get_shell(config, shell_args) | 65 shell, common_shell_args = shell_arguments.get_shell(config, shell_args) |
| 66 except shell_arguments.ShellConfigurationException as e: | 66 except shell_config.ShellConfigurationException as e: |
| 67 print e | 67 print e |
| 68 return 1 | 68 return 1 |
| 69 | 69 |
| 70 target_os = "android" if script_args.android else "linux" | 70 target_os = "android" if script_args.android else "linux" |
| 71 test_list_globals = {"target_os": target_os} | 71 test_list_globals = {"target_os": target_os} |
| 72 exec script_args.test_list_file in test_list_globals | 72 exec script_args.test_list_file in test_list_globals |
| 73 test_list = test_list_globals["tests"] | 73 test_list = test_list_globals["tests"] |
| 74 | 74 |
| 75 succeeded = True | 75 succeeded = True |
| 76 for test_dict in test_list: | 76 for test_dict in test_list: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 101 print "Unrecognized test type in %r" % test_dict | 101 print "Unrecognized test type in %r" % test_dict |
| 102 | 102 |
| 103 print "Succeeded" if apptest_result else "Failed" | 103 print "Succeeded" if apptest_result else "Failed" |
| 104 _logger.info("Completed: %s" % test_name) | 104 _logger.info("Completed: %s" % test_name) |
| 105 if not apptest_result: | 105 if not apptest_result: |
| 106 succeeded = False | 106 succeeded = False |
| 107 return 0 if succeeded else 1 | 107 return 0 if succeeded else 1 |
| 108 | 108 |
| 109 if __name__ == '__main__': | 109 if __name__ == '__main__': |
| 110 sys.exit(main()) | 110 sys.exit(main()) |
| OLD | NEW |