[PATCH] D56219: [gn build] Add build files for LLVM unittests with a custom main() function

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 11:02:08 PST 2019


thakis marked an inline comment as done.
thakis added inline comments.


================
Comment at: llvm/utils/gn/secondary/llvm/utils/unittest/unittest.gni:53
+# //llvm/utils/unittest/UnitTestMain.
+template("unittest_with_custom_main") {
+  executable(target_name) {
----------------
phosek wrote:
> I'm not a big fan of the name, have you considered naming it e.g. `gtest`?
`unittest_with_custom_gtest`? Or just `gtest`?

The "normal" unittest target is called `unittest`, and this one is a variant on that, so `unittest_foo` with some value for `foo` seems like a good name to me. The defining characteristic of these tests is that they contain a custom `main()` function, hence the current name. I'm very open for different naming suggestions, but imho this template should be named similarly to the existing `unittest` template. (Also, `unittest` is used like 50 times, this one only 3 times, so making it look familiar and self-consistent seems more important to me than making it short.)

Also, D56324 is another, similar patch that adds yet another similar template.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56219/new/

https://reviews.llvm.org/D56219





More information about the llvm-commits mailing list