add build and test instructions to readme
This commit is contained in:
@@ -13,7 +13,7 @@ include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG v1.17.x # Use a specific version tag or commit hash
|
||||
GIT_TAG v1.17.x
|
||||
)
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
|
||||
@@ -39,9 +39,17 @@ target_include_directories(maiden_test PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||
)
|
||||
|
||||
target_compile_options(maiden_test PRIVATE --coverage)
|
||||
target_link_options(maiden_test PRIVATE --coverage)
|
||||
|
||||
# TODO: add option for disabling tests (like if target == DEBUG then tests on, otherwise tests off)
|
||||
target_link_libraries(maiden_test PRIVATE
|
||||
GTest::gmock
|
||||
GTest::gmock_main
|
||||
)
|
||||
|
||||
include(CTest)
|
||||
enable_testing() # ctest is whatever
|
||||
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(maiden_test)
|
||||
|
||||
Reference in New Issue
Block a user