Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: mojo/tools/get_test_list.py

Issue 1384243002: Adds the ability to run pure Go unit tests in the Mojo test suite. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Further code review comment responses. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 # TODO(smklein): Add for Android once tests are pexes. 110 # TODO(smklein): Add for Android once tests are pexes.
111 AddXvfbEntry("NaCl app tests", 111 AddXvfbEntry("NaCl app tests",
112 [os.path.join("mojo", "tools", "apptest_runner.py"), 112 [os.path.join("mojo", "tools", "apptest_runner.py"),
113 os.path.join("mojo", "tools", "data", "nacl_apptests"), 113 os.path.join("mojo", "tools", "data", "nacl_apptests"),
114 build_dir] + verbose_flags) 114 build_dir] + verbose_flags)
115 115
116 # Go unit tests (Linux-only): 116 # Go unit tests (Linux-only):
117 if (target_os == Config.OS_LINUX and 117 if (target_os == Config.OS_LINUX and
118 config.sanitizer != Config.SANITIZER_ASAN and 118 config.sanitizer != Config.SANITIZER_ASAN and
119 ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT, "go")): 119 ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT, "go")):
120 # Go system tests:
121 AddEntry("Go system tests",
122 [os.path.join(build_dir, "obj", "mojo", "go", "system_test")])
123
124 # Pure Go unit tests:
125 if "go_build_tool" in config.values:
126 go_tool = config.values["go_build_tool"]
127 else:
128 # Note(rudominer) This branch is necessary for when this script is
129 # run on the bots. In that case the config.values dictionary is built in
130 # the bot's recipe script and does not contain a value for
131 # "go_build_tool." Consider adding that value there instead.
132 go_tool = os.path.join(Paths().src_root, "third_party", "go", "tool",
viettrungluu 2015/10/06 21:06:28 In particular, if the go_build_tool directory shou
rudominer 2015/10/09 18:30:30 Done.
133 "linux_amd64", "bin", "go")
120 AddEntry("Go unit tests", 134 AddEntry("Go unit tests",
121 [os.path.join(build_dir, "obj", "mojo", "go", "system_test")]) 135 ["python", os.path.join("mojo", "tools", "run_pure_go_tests.py"),
136 go_tool, os.path.join("mojo", "tools", "data", "gotests")])
122 137
123 # Python unit tests: 138 # Python unit tests:
124 if ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT, "python"): 139 if ShouldRunTest(Config.TEST_TYPE_DEFAULT, Config.TEST_TYPE_UNIT, "python"):
125 AddEntry("Python unit tests", 140 AddEntry("Python unit tests",
126 ["python", os.path.join("mojo", "tools", 141 ["python", os.path.join("mojo", "tools",
127 "run_mojo_python_tests.py")]) 142 "run_mojo_python_tests.py")])
128 143
129 # Python bindings tests (Linux-only): 144 # Python bindings tests (Linux-only):
130 # See http://crbug.com/438781 for details on asan exclusion. 145 # See http://crbug.com/438781 for details on asan exclusion.
131 if (target_os == Config.OS_LINUX and 146 if (target_os == Config.OS_LINUX and
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 config = Config(**json.load(args.config_file)) 256 config = Config(**json.load(args.config_file))
242 test_list = GetTestList(config) 257 test_list = GetTestList(config)
243 json.dump(test_list, args.test_list_file, indent=2) 258 json.dump(test_list, args.test_list_file, indent=2)
244 args.test_list_file.write("\n") 259 args.test_list_file.write("\n")
245 260
246 return 0 261 return 0
247 262
248 263
249 if __name__ == "__main__": 264 if __name__ == "__main__":
250 sys.exit(main()) 265 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698