Skip to content

Commit

Permalink
gtest: Make gtest an install dependency
Browse files Browse the repository at this point in the history
It's probably a good thing to have googletest as an install dependency.

Signed-off-by: Johannes Demel <[email protected]>
  • Loading branch information
jdemel committed Aug 19, 2024
1 parent e4db17d commit 1272281
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
35 changes: 15 additions & 20 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
#

add_subdirectory(googletest)
if(NOT ENABLE_TESTING)
return()
endif(NOT ENABLE_TESTING)

find_package(fmt REQUIRED)
find_package(fmt)
find_package(GTest)

if(NOT fmt_FOUND OR NOT GTest_FOUND)
message(warning "Missing fmtlib and/or googletest for this test suite")
return()
endif(NOT fmt_FOUND OR NOT GTest_FOUND)

file(GLOB volk_test_files "test_*.cc")

Expand All @@ -18,11 +26,11 @@ add_executable(
${volk_test_files}
)

target_link_libraries(
volk_tests
gtest_main
volk
fmt::fmt
target_link_libraries(volk_tests
PRIVATE
GTest::gtest_main
volk
fmt::fmt
)

include(GoogleTest)
Expand All @@ -37,16 +45,3 @@ target_include_directories(volk_tests
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
)

# if(ENABLE_STATIC_LIBS)
# target_link_libraries(volk_tests PRIVATE volk_static)
# set_target_properties(volk_tests PROPERTIES LINK_FLAGS "-static")
# else()
# target_link_libraries(volk_tests PRIVATE volk)
# endif()

# install(
# TARGETS volk_tests
# DESTINATION bin
# COMPONENT "volk"
# )
1 change: 0 additions & 1 deletion tests/googletest
Submodule googletest deleted from 9a32ae
1 change: 0 additions & 1 deletion tests/test_volk_32f_x3_sum_of_poly_32f.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,4 @@ TEST_P(volk_32f_x3_sum_of_poly_32f_test, unaligned)

INSTANTIATE_TEST_SUITE_P(volk_32f_x3_sum_of_poly_32f,
volk_32f_x3_sum_of_poly_32f_test,
// testing::Values(8, 32)
testing::Values(7, 32, 128, 1023, 65535, 131071));

0 comments on commit 1272281

Please sign in to comment.