OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
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 """A test runner for gtest application tests.""" | 6 """A test runner for gtest application tests.""" |
7 | 7 |
8 import argparse | 8 import argparse |
9 import ast | 9 import ast |
10 import logging | 10 import logging |
(...skipping 30 matching lines...) Expand all Loading... |
41 is_android = (config.target_os == Config.OS_ANDROID) | 41 is_android = (config.target_os == Config.OS_ANDROID) |
42 android_context = android.PrepareShellRun(config) if is_android else None | 42 android_context = android.PrepareShellRun(config) if is_android else None |
43 | 43 |
44 gtest.set_color() | 44 gtest.set_color() |
45 mojo_paths = Paths(config) | 45 mojo_paths = Paths(config) |
46 | 46 |
47 exit_code = 0 | 47 exit_code = 0 |
48 for apptest_dict in apptest_list: | 48 for apptest_dict in apptest_list: |
49 if apptest_dict.get("disabled"): | 49 if apptest_dict.get("disabled"): |
50 continue | 50 continue |
| 51 if not config.match_target_os(apptest_dict.get("target_os", [])): |
| 52 continue |
51 | 53 |
52 apptest = apptest_dict["test"] | 54 apptest = apptest_dict["test"] |
53 apptest_args = apptest_dict.get("test-args", []) | 55 apptest_args = apptest_dict.get("test-args", []) |
54 shell_args = apptest_dict.get("shell-args", []) | 56 shell_args = apptest_dict.get("shell-args", []) |
55 launched_services = apptest_dict.get("launched-services", []) | 57 launched_services = apptest_dict.get("launched-services", []) |
56 | 58 |
57 print "Running " + apptest + "...", | 59 print "Running " + apptest + "...", |
58 sys.stdout.flush() | 60 sys.stdout.flush() |
59 | 61 |
60 # List the apptest fixtures so they can be run independently for isolation. | 62 # List the apptest fixtures so they can be run independently for isolation. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 run_apps=False)) as apps: | 108 run_apps=False)) as apps: |
107 launcher_args = [ | 109 launcher_args = [ |
108 '--shell-path=' + apps.socket_path, | 110 '--shell-path=' + apps.socket_path, |
109 '--app-url=' + application, | 111 '--app-url=' + application, |
110 '--app-path=' + mojo_paths.FileFromUrl(application)] | 112 '--app-path=' + mojo_paths.FileFromUrl(application)] |
111 return gtest.run_test(config, launcher_args, run_launcher=True) | 113 return gtest.run_test(config, launcher_args, run_launcher=True) |
112 | 114 |
113 | 115 |
114 if __name__ == '__main__': | 116 if __name__ == '__main__': |
115 sys.exit(main()) | 117 sys.exit(main()) |
OLD | NEW |