How to setup Google C++ Testing Framework (gtest)

2019-01-02 22:30发布

It is not documented on the web site and people seems having problem setting up the framework. Can someone please show step by step introduction to a sample project setup.

7条回答
小情绪 Triste *
2楼-- · 2019-01-02 23:04

If you don t want to write your own main() for tests you can use the main() function defined in gtest_main.lib but then you get linker errors "Entry point must be defined" in VS2012. In your test-project set ProjectProperties->Linker->System->SubSystem to "Console" as this will force VS2012 to look for an entry point called "main()" and will find it in gtest_main.lib (provided you ve linked it in properly).

查看更多
登录 后发表回答