Skip to content

Commit

Permalink
Removed unnecessary OpenMP tests.
Browse files Browse the repository at this point in the history
These should already be abstracted away by tatami/irlba's parallelize().
  • Loading branch information
LTLA committed Sep 2, 2024
1 parent b206605 commit b809221
Showing 1 changed file with 17 additions and 33 deletions.
50 changes: 17 additions & 33 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,25 @@ FetchContent_MakeAvailable(scran_tests)

enable_testing()

add_executable(
libtest
src/simple_pca.cpp
src/blocked_pca.cpp
)

target_link_libraries(
libtest
scran_pca
scran_tests
)

target_compile_options(libtest PRIVATE -Wall -Wpedantic -Wextra)

option(CODE_COVERAGE "Enable coverage testing" OFF)
set(DO_CODE_COVERAGE OFF)
if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(DO_CODE_COVERAGE ON)
target_compile_options(libtest PRIVATE -O0 -g --coverage)
target_link_options(libtest PRIVATE --coverage)
endif()

include(GoogleTest)

macro(create_test name)
add_executable(
${name}
src/simple_pca.cpp
src/blocked_pca.cpp
)

target_link_libraries(
${name}
scran_pca
scran_tests
)

target_compile_options(${name} PRIVATE -Wall -Wpedantic -Wextra)

if(DO_CODE_COVERAGE)
target_compile_options(${name} PRIVATE -O0 -g --coverage)
target_link_options(${name} PRIVATE --coverage)
endif()

gtest_discover_tests(${name})
endmacro()

create_test(libtest)

find_package(OpenMP)
if (OpenMP_FOUND)
create_test(omptest)
target_link_libraries(omptest OpenMP::OpenMP_CXX)
endif()
gtest_discover_tests(libtest)

0 comments on commit b809221

Please sign in to comment.