Created
May 7, 2020 16:47
-
-
Save mfdeveloper/f822aea8495884bd1c019a3072f3690c to your computer and use it in GitHub Desktop.
Add support to GoogleTest library for unit tests on C++ Cmake projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This commands/functions bellow is to allow Cmake C++ projects to use GoogleTest library to TDD (unit tests) | |
# The package gtest is compatible with built-in CMake targets: | |
enable_testing() | |
find_package(GTest CONFIG REQUIRED) | |
target_link_libraries(main PRIVATE GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main) | |
add_test(AllTestsInMain main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment