#
# {{ project_name }} tests
#
cmake_minimum_required(VERSION 3.21)

# cofigure unittest using GoogleTest
include(FetchContent)
FetchContent_Declare(
  googletest
  GIT_REPOSITORY https://github.com/google/googletest.git
  GIT_TAG release-1.12.1
)
FetchContent_MakeAvailable(googletest)
include(GoogleTest)

# generate testcases
add_executable({{ project_name|lower }}_test
    test_{{ project_name|lower }}.cpp
)
target_link_libraries({{ project_name|lower }}_test
    {{ project_name|lower }}
    GTest::gtest_main
)
include_directories(${PROJECT_SOURCE_DIR}/src ${GTEST_INCLUDE_DIRS})

gtest_discover_tests({{ project_name|lower }}_test)
