diff --git a/CMakeLists.txt b/CMakeLists.txt index 546b1b3..fff30fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,4 +32,8 @@ endif() add_subdirectory(src/beman/exemplar) +if(BUILD_TESTING) + add_subdirectory(tests/beman/exemplar) +endif() + add_subdirectory(examples) diff --git a/src/beman/exemplar/CMakeLists.txt b/src/beman/exemplar/CMakeLists.txt index c887c7f..edee25c 100644 --- a/src/beman/exemplar/CMakeLists.txt +++ b/src/beman/exemplar/CMakeLists.txt @@ -23,16 +23,3 @@ install( RUNTIME DESTINATION $<$:debug/>${CMAKE_INSTALL_BINDIR} FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) - -if(BUILD_TESTING) - include(GoogleTest) - - add_executable(beman.exemplar.tests) - target_sources(beman.exemplar.tests PRIVATE identity.t.cpp) - target_link_libraries( - beman.exemplar.tests - PRIVATE beman::exemplar GTest::gtest GTest::gtest_main - ) - - gtest_add_tests(beman.exemplar.tests "" AUTO) -endif() diff --git a/tests/beman/exemplar/CMakeLists.txt b/tests/beman/exemplar/CMakeLists.txt new file mode 100644 index 0000000..9e0e075 --- /dev/null +++ b/tests/beman/exemplar/CMakeLists.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +include(GoogleTest) + +add_executable(beman.exemplar.tests.identity) +target_sources(beman.exemplar.tests.identity PRIVATE identity.test.cpp) +target_link_libraries( + beman.exemplar.tests.identity + PRIVATE beman::exemplar GTest::gtest GTest::gtest_main +) + +gtest_add_tests(beman.exemplar.tests.identity "" AUTO) diff --git a/src/beman/exemplar/identity.t.cpp b/tests/beman/exemplar/identity.test.cpp similarity index 100% rename from src/beman/exemplar/identity.t.cpp rename to tests/beman/exemplar/identity.test.cpp