add build and test instructions to readme

This commit is contained in:
2026-05-07 23:56:48 -05:00
parent 35cc73b04f
commit b7e509ce96
2 changed files with 48 additions and 4 deletions

View File

@@ -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)