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 """Central list of tests to run (as appropriate for a given config). Add tests | 6 """Central list of tests to run (as appropriate for a given config). Add tests |
7 to run by modifying this file. | 7 to run by modifying this file. |
8 | 8 |
9 Note that this file is both imported (by mojob.py) and run directly (via a | 9 Note that this file is both imported (by mojob.py) and run directly (via a |
10 recipe).""" | 10 recipe).""" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 # TODO(vtl): Currently, we only know how to run tests for Android, Linux, or | 68 # TODO(vtl): Currently, we only know how to run tests for Android, Linux, or |
69 # Windows. | 69 # Windows. |
70 if target_os not in (Config.OS_ANDROID, Config.OS_LINUX, Config.OS_WINDOWS): | 70 if target_os not in (Config.OS_ANDROID, Config.OS_LINUX, Config.OS_WINDOWS): |
71 return test_list | 71 return test_list |
72 | 72 |
73 # Tests run by default ------------------------------------------------------- | 73 # Tests run by default ------------------------------------------------------- |
74 | 74 |
75 # C++ unit tests: | 75 # C++ unit tests: |
76 if ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT): | 76 if ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT): |
77 unit_test_command = [os.path.join("mojo", "tools", "test_runner.py")] | 77 unit_test_command = [os.path.join("mojo", "tools", "test_runner.py")] |
78 if target_os == Config.OS_ANDROID: | |
79 unit_test_command.append("--android") | |
80 unit_test_command.extend( | 78 unit_test_command.extend( |
81 [os.path.join("mojo", "tools", "data", "unittests"), build_dir, | 79 [os.path.join("mojo", "tools", "data", "unittests"), build_dir, |
82 "mojob_test_successes"]) | 80 "mojob_test_successes"]) |
83 AddXvfbEntry("Unit tests", unit_test_command) | 81 AddXvfbEntry("Unit tests", unit_test_command) |
84 | 82 |
85 # C++ app tests: | 83 # C++ app tests: |
86 if target_os != Config.OS_ANDROID and ShouldRunTest(Config.TEST_TYPE_DEFAULT, | 84 if ShouldRunTest(Config.TEST_TYPE_DEFAULT, "app"): |
87 "app"): | |
88 AddXvfbEntry("App tests", | 85 AddXvfbEntry("App tests", |
89 [os.path.join("mojo", "tools", "apptest_runner.py"), | 86 [os.path.join("mojo", "tools", "apptest_runner.py"), |
90 os.path.join("mojo", "tools", "data", "apptests"), | 87 os.path.join("mojo", "tools", "data", "apptests"), |
91 build_dir]) | 88 build_dir]) |
92 | 89 |
93 # Python unit tests: | 90 # Python unit tests: |
94 if ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT, "python"): | 91 if ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT, "python"): |
95 AddEntry("Python unit tests", | 92 AddEntry("Python unit tests", |
96 ["python", os.path.join("mojo", "tools", | 93 ["python", os.path.join("mojo", "tools", |
97 "run_mojo_python_tests.py")]) | 94 "run_mojo_python_tests.py")]) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 config = Config(**json.load(args.config_file)) | 200 config = Config(**json.load(args.config_file)) |
204 test_list = GetTestList(config) | 201 test_list = GetTestList(config) |
205 json.dump(test_list, args.test_list_file, indent=2) | 202 json.dump(test_list, args.test_list_file, indent=2) |
206 args.test_list_file.write("\n") | 203 args.test_list_file.write("\n") |
207 | 204 |
208 return 0 | 205 return 0 |
209 | 206 |
210 | 207 |
211 if __name__ == "__main__": | 208 if __name__ == "__main__": |
212 sys.exit(main()) | 209 sys.exit(main()) |
OLD | NEW |