When called from a fixture, this menu additionally includes SetUp Method and TearDown Method: Google Test run/debug configurationĪlthough Google Test provides the main() entry, and you can run tests as regular applications, we recommend using the dedicated Google Test run/debug configuration. In the files with gtest included, you can generate code for tests and test fixtures using the Generate menu Alt+Insert. Take a look at this example in Unit Testing Tutorial. When writing tests, make sure to add #include "gtest/gtest.h" at the beginning of every. In your root CMakeLists.txt script, add the add_subdirectory(Google_tests) command to the end, then reload the project. Target_link_libraries(Google_Tests_run gtest gtest_main) # 'test1.cpp tests2.cpp' are source files with testsĪdd_executable(Google_Tests_run test1.cpp tests2.cpp) # 'lib' is the folder with Google Test sources
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |