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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | 62 |
63 try: | 63 try: |
64 config = shell_config.get_shell_config(script_args) | 64 config = shell_config.get_shell_config(script_args) |
65 if script_args.android: | 65 if script_args.android: |
66 # We need root to have the stdout of the shell available on the host. | 66 # We need root to have the stdout of the shell available on the host. |
67 config.require_root = True | 67 config.require_root = True |
68 shell, common_shell_args = shell_arguments.get_shell(config, shell_args) | 68 shell, common_shell_args = shell_arguments.get_shell(config, shell_args) |
69 # Tests must be reproducible. Start with an empty cache. | |
70 common_shell_args.append("--args-for=mojo:url_response_disk_cache --clear") | |
ppi
2015/09/15 15:21:22
good idea! Would you mind extracting the url into
qsr
2015/09/16 11:46:37
Done.
| |
69 except shell_config.ShellConfigurationException as e: | 71 except shell_config.ShellConfigurationException as e: |
70 print e | 72 print e |
71 return 1 | 73 return 1 |
72 | 74 |
73 target_os = "android" if script_args.android else "linux" | 75 target_os = "android" if script_args.android else "linux" |
74 test_list_globals = {"target_os": target_os} | 76 test_list_globals = {"target_os": target_os} |
75 exec script_args.test_list_file in test_list_globals | 77 exec script_args.test_list_file in test_list_globals |
76 test_list = test_list_globals["tests"] | 78 test_list = test_list_globals["tests"] |
77 | 79 |
78 succeeded = True | 80 succeeded = True |
(...skipping 25 matching lines...) Expand all Loading... | |
104 print "Unrecognized test type in %r" % test_dict | 106 print "Unrecognized test type in %r" % test_dict |
105 | 107 |
106 print "Succeeded" if apptest_result else "Failed" | 108 print "Succeeded" if apptest_result else "Failed" |
107 _logger.info("Completed: %s" % test_name) | 109 _logger.info("Completed: %s" % test_name) |
108 if not apptest_result: | 110 if not apptest_result: |
109 succeeded = False | 111 succeeded = False |
110 return 0 if succeeded else 1 | 112 return 0 if succeeded else 1 |
111 | 113 |
112 if __name__ == '__main__': | 114 if __name__ == '__main__': |
113 sys.exit(main()) | 115 sys.exit(main()) |
OLD | NEW |