Skip to content

Commit

Permalink
Remove the unnecessary OpenMP tests.
Browse files Browse the repository at this point in the history
The parallelization scheme is coverered by tatami::parallelize() anyway, and we
don't have any OpenMP macros, so there's no need for separate tests.
  • Loading branch information
LTLA committed Sep 2, 2024
1 parent d9b62af commit 343176d
Showing 1 changed file with 18 additions and 34 deletions.
52 changes: 18 additions & 34 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,26 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(scran_tests)

add_executable(
libtest
src/aggregate_across_cells.cpp
src/combine_factors.cpp
src/clean_factor.cpp
)

target_link_libraries(
libtest
scran_aggregate
scran_tests
)

target_compile_options(libtest PRIVATE -Wall -Werror -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/aggregate_across_cells.cpp
src/combine_factors.cpp
src/clean_factor.cpp
)

target_link_libraries(
${name}
scran_aggregate
scran_tests
)

target_compile_options(${name} PRIVATE -Wall -Werror -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 343176d

Please sign in to comment.