| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 if (target_os == Config.OS_LINUX and | 106 if (target_os == Config.OS_LINUX and |
| 107 ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT, | 107 ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT, |
| 108 "python") and | 108 "python") and |
| 109 config.sanitizer != Config.SANITIZER_ASAN): | 109 config.sanitizer != Config.SANITIZER_ASAN): |
| 110 AddEntry("Python bindings tests", | 110 AddEntry("Python bindings tests", |
| 111 ["python", | 111 ["python", |
| 112 os.path.join("mojo", "tools", | 112 os.path.join("mojo", "tools", |
| 113 "run_mojo_python_bindings_tests.py"), | 113 "run_mojo_python_bindings_tests.py"), |
| 114 "--build-dir=" + build_dir]) | 114 "--build-dir=" + build_dir]) |
| 115 | 115 |
| 116 # NaCl tests (Linux only): |
| 117 if target_os == Config.OS_LINUX and config.sanitizer != Config.SANITIZER_ASAN: |
| 118 AddEntry("NaCl tests", |
| 119 [os.path.join(build_dir, "monacl_shell"), |
| 120 os.path.join(build_dir, "irt_" + config.target_cpu, |
| 121 "irt_mojo.nexe"), |
| 122 os.path.join(build_dir, "clang_newlib_" + config.target_cpu, |
| 123 "monacl_test.nexe")]) |
| 124 |
| 125 AddXvfbEntry("NaCl app tests", |
| 126 [os.path.join("mojo", "tools", "apptest_runner.py"), |
| 127 os.path.join("mojo", "tools", "data", "nacl_apptests"), |
| 128 build_dir] + verbose_flags) |
| 129 |
| 116 # Sky tests (Linux-only): | 130 # Sky tests (Linux-only): |
| 117 # TODO(abarth): Re-enabled in ASAN once the DartVM works in ASAN. | 131 # TODO(abarth): Re-enabled in ASAN once the DartVM works in ASAN. |
| 118 # See https://code.google.com/p/dart/issues/detail?id=22122 | 132 # See https://code.google.com/p/dart/issues/detail?id=22122 |
| 119 if (target_os == Config.OS_LINUX and | 133 if (target_os == Config.OS_LINUX and |
| 120 ShouldRunTest(Config.TEST_TYPE_DEFAULT, "sky") and | 134 ShouldRunTest(Config.TEST_TYPE_DEFAULT, "sky") and |
| 121 config.sanitizer != Config.SANITIZER_ASAN): | 135 config.sanitizer != Config.SANITIZER_ASAN): |
| 122 sky_command = ["python", | 136 sky_command = ["python", |
| 123 "sky/tools/test_sky", | 137 "sky/tools/test_sky", |
| 124 "-t", os.path.basename(build_dir), | 138 "-t", os.path.basename(build_dir), |
| 125 "--no-new-test-results", "--no-show-results", "--verbose"] | 139 "--no-new-test-results", "--no-show-results", "--verbose"] |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_INTEGRATION): | 184 Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_INTEGRATION): |
| 171 AddEntry("Integration test (MojoTest)", | 185 AddEntry("Integration test (MojoTest)", |
| 172 ["python", | 186 ["python", |
| 173 os.path.join("build", "android", "test_runner.py"), | 187 os.path.join("build", "android", "test_runner.py"), |
| 174 "instrumentation", | 188 "instrumentation", |
| 175 "--test-apk=MojoTest", | 189 "--test-apk=MojoTest", |
| 176 "--output-directory=%s" % build_dir, | 190 "--output-directory=%s" % build_dir, |
| 177 "--test_data=bindings:mojo/public/interfaces/bindings/tests/data"] | 191 "--test_data=bindings:mojo/public/interfaces/bindings/tests/data"] |
| 178 + verbose_flags) | 192 + verbose_flags) |
| 179 | 193 |
| 180 # Other (non-default) tests -------------------------------------------------- | |
| 181 | |
| 182 # Dart unit tests: | |
| 183 if ShouldRunTest("dart"): | |
| 184 AddXvfbEntry("Dart unit tests", | |
| 185 [os.path.join("mojo", "tools", "test_runner.py"), | |
| 186 os.path.join("mojo", "tools", "data", "dart_unittests"), | |
| 187 build_dir, "mojob_test_successes"] + verbose_flags) | |
| 188 AddXvfbEntry("Dart App tests", | |
| 189 [os.path.join("mojo", "tools", "apptest_runner.py"), | |
| 190 os.path.join("mojo", "tools", "data", "dart_apptests"), | |
| 191 build_dir] + verbose_flags) | |
| 192 | |
| 193 # NaCl tests: | |
| 194 if ShouldRunTest("nacl"): | |
| 195 AddEntry("NaCl tests", | |
| 196 [os.path.join(build_dir, "monacl_shell"), | |
| 197 os.path.join(build_dir, "irt_" + config.target_cpu, | |
| 198 "irt_mojo.nexe"), | |
| 199 os.path.join(build_dir, "clang_newlib_" + config.target_cpu, | |
| 200 "monacl_test.nexe")]) | |
| 201 | |
| 202 AddXvfbEntry("NaCl app tests", | |
| 203 [os.path.join("mojo", "tools", "apptest_runner.py"), | |
| 204 os.path.join("mojo", "tools", "data", "nacl_apptests"), | |
| 205 build_dir] + verbose_flags) | |
| 206 | |
| 207 # ---------------------------------------------------------------------------- | |
| 208 | |
| 209 return test_list | 194 return test_list |
| 210 | 195 |
| 211 | 196 |
| 212 def main(): | 197 def main(): |
| 213 parser = argparse.ArgumentParser(description="Gets tests to execute.") | 198 parser = argparse.ArgumentParser(description="Gets tests to execute.") |
| 214 parser.add_argument("config_file", metavar="config.json", | 199 parser.add_argument("config_file", metavar="config.json", |
| 215 type=argparse.FileType("rb"), | 200 type=argparse.FileType("rb"), |
| 216 help="Input JSON file with test configuration.") | 201 help="Input JSON file with test configuration.") |
| 217 parser.add_argument("test_list_file", metavar="test_list.json", nargs="?", | 202 parser.add_argument("test_list_file", metavar="test_list.json", nargs="?", |
| 218 type=argparse.FileType("wb"), default=sys.stdout, | 203 type=argparse.FileType("wb"), default=sys.stdout, |
| 219 help="Output JSON file with test list.") | 204 help="Output JSON file with test list.") |
| 220 args = parser.parse_args() | 205 args = parser.parse_args() |
| 221 | 206 |
| 222 config = Config(**json.load(args.config_file)) | 207 config = Config(**json.load(args.config_file)) |
| 223 test_list = GetTestList(config) | 208 test_list = GetTestList(config) |
| 224 json.dump(test_list, args.test_list_file, indent=2) | 209 json.dump(test_list, args.test_list_file, indent=2) |
| 225 args.test_list_file.write("\n") | 210 args.test_list_file.write("\n") |
| 226 | 211 |
| 227 return 0 | 212 return 0 |
| 228 | 213 |
| 229 | 214 |
| 230 if __name__ == "__main__": | 215 if __name__ == "__main__": |
| 231 sys.exit(main()) | 216 sys.exit(main()) |
| OLD | NEW |