CATCH_CONFIG_MAIN 的 gtest 等价物是多少?

What's the gtest equivalent of CATCH_CONFIG_MAIN?

#define CATCH_CONFIG_MAIN  // This tells Catch to provide a main() - only do this in one cpp file

谷歌搜索后我找不到 gtest 的替代品

根据their primer

But maybe you think that writing all those main() functions is too much work? We agree with you completely and that's why Google Test provides a basic implementation of main(). If it fits your needs, then just link your test with gtest_main library and you are good to go.

因此,与其要求库通过宏生成 main 的定义,不如 link 在 gtest_main 库中包含一个定义。