From 32a2d8d6f2ff6cc31c46fbab94078333bf162c4c Mon Sep 17 00:00:00 2001 From: David Sankel Date: Fri, 18 Oct 2024 20:47:17 -0400 Subject: [PATCH] Apply [DIRECTORY.TESTS] and [FILE.TEST_NAMES] --- CMakeLists.txt | 4 ++++ src/beman/exemplar/CMakeLists.txt | 13 ------------- tests/beman/exemplar/CMakeLists.txt | 12 ++++++++++++ .../beman/exemplar/identity.test.cpp | 0 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 tests/beman/exemplar/CMakeLists.txt rename src/beman/exemplar/identity.t.cpp => tests/beman/exemplar/identity.test.cpp (100%) 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