| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 formatter_class=argparse.RawDescriptionHelpFormatter, | 58 formatter_class=argparse.RawDescriptionHelpFormatter, |
| 59 description=_DESCRIPTION) | 59 description=_DESCRIPTION) |
| 60 parser.add_argument("test_list_file", type=file, | 60 parser.add_argument("test_list_file", type=file, |
| 61 help="a file listing apptests to run") | 61 help="a file listing apptests to run") |
| 62 shell_config.add_shell_arguments(parser) | 62 shell_config.add_shell_arguments(parser) |
| 63 | 63 |
| 64 script_args, shell_args = parser.parse_known_args() | 64 script_args, shell_args = parser.parse_known_args() |
| 65 | 65 |
| 66 try: | 66 try: |
| 67 config = shell_config.get_shell_config(script_args) | 67 config = shell_config.get_shell_config(script_args) |
| 68 if script_args.android: | |
| 69 # We need root to have the stdout of the shell available on the host. | |
| 70 config.require_root = True | |
| 71 shell, common_shell_args = shell_arguments.get_shell(config, shell_args) | 68 shell, common_shell_args = shell_arguments.get_shell(config, shell_args) |
| 72 # Tests must be reproducible, start with empty caches. | 69 # Tests must be reproducible, start with empty caches. |
| 73 common_shell_args.append( | 70 common_shell_args.append( |
| 74 "--args-for=%s %s" % (_CACHE_SERVICE_URL, "--clear")) | 71 "--args-for=%s %s" % (_CACHE_SERVICE_URL, "--clear")) |
| 75 common_shell_args.append( | 72 common_shell_args.append( |
| 76 "--args-for=%s %s" % (_NETWORK_SERVICE_URL, "--clear")) | 73 "--args-for=%s %s" % (_NETWORK_SERVICE_URL, "--clear")) |
| 77 except shell_config.ShellConfigurationException as e: | 74 except shell_config.ShellConfigurationException as e: |
| 78 print e | 75 print e |
| 79 return 1 | 76 return 1 |
| 80 | 77 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 print "Unrecognized test type in %r" % test_dict | 109 print "Unrecognized test type in %r" % test_dict |
| 113 | 110 |
| 114 print "Succeeded" if apptest_result else "Failed" | 111 print "Succeeded" if apptest_result else "Failed" |
| 115 _logger.info("Completed: %s" % test_name) | 112 _logger.info("Completed: %s" % test_name) |
| 116 if not apptest_result: | 113 if not apptest_result: |
| 117 succeeded = False | 114 succeeded = False |
| 118 return 0 if succeeded else 1 | 115 return 0 if succeeded else 1 |
| 119 | 116 |
| 120 if __name__ == '__main__': | 117 if __name__ == '__main__': |
| 121 sys.exit(main()) | 118 sys.exit(main()) |
| OLD | NEW |