COLMAP_ADD_LIBRARY( NAME colmap_gtest_main SRCS gtest_main.cc PUBLIC_LINK_LIBS glog::glog GTest::gmock_main ) endif() COLMAP_ADD_TEST( NAME cache_test SRCS cache_test.cc37 changes: 37 additions & 0 deletions 37 src/colmap/util/gtest_main.cc Original file line numberDiff line numberDif...
一、全局的事件机制(针对整个测试程序) 实现全局的事件机制,需要创建一个自己的类,然后继承testing::Environment类,然后分别实现成员函数SetUp()和TearDown(),同时在main函数内进行调用,即"testing::AddGlobalTestEnvironment(new MyEnvironment);",通过调用函数我们可以添加多个全局的事件机制。 SetUp()函数是在所有测试...
在(1)中,func_test.cpp中有main()函数,但这不是必须的。 $ catfunc.cppintfunc_to_be_tested(inta,intb){returna-b;} $ cat func_test.cpp#include<gtest/gtest.h>intfunc_to_be_tested(int,int);TEST(TestSuiteName,TestCaseName){EXPECT_EQ(1,func_to_be_tested(3,2));} $ g++func.cpp fu...
Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {{ message }} google / googletest Public Notifications You must be signed in to change notification settings Fork 10.2k Star 35.1k ...
We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {...
gmock-matchers-misc_test.cc gmock-matchers_test.h gmock-more-actions_test.cc gmock-nice-strict_test.cc gmock-port_test.cc gmock-pp-string_test.cc gmock-pp_test.cc gmock-spec-builders_test.cc gmock_all_test.cc gmock_ex_test.cc gmock_leak_test.py gmock_leak_test_.cc gmock_link2_test...
In the example above, we set our normal gMock expectations, but then add an additional action to notify the Notification object. Now we can just call Notification::WaitForNotification() in the main thread to wait for the asynchronous call to finish. After that, our test suite is complete ...