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::parallelize().
  • Loading branch information
LTLA committed Sep 2, 2024
1 parent 321041c commit d20e655
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/fit_variance_trend.cpp
src/model_gene_variances.cpp
src/choose_highly_variable_genes.cpp
)

target_link_libraries(
libtest
scran_variances
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/fit_variance_trend.cpp
src/model_gene_variances.cpp
src/choose_highly_variable_genes.cpp
)

target_link_libraries(
${name}
scran_variances
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 d20e655

Please sign in to comment.