Skip to content

Commit

Permalink
Make building tests an option
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienPean committed Dec 18, 2022
1 parent 9682288 commit b66298f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -622,11 +622,7 @@ endif()
############################
# TEST
############################
if(TESTS)
enable_testing()

set(CMAKE_CTEST_COMMAND ctest -V)

function(build_tests)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/TESTS)

add_executable(dnsimp_test TESTS/dnsimp.f TESTS/mmio.f TESTS/debug.h)
Expand Down Expand Up @@ -783,6 +779,12 @@ if(TESTS)
add_test(icb_parpack_cpp_tst mpirun -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_cpp)
endif()
endif()
endfunction(build_tests)

if(TESTS)
enable_testing()
set(CMAKE_CTEST_COMMAND ctest -V)
build_tests()
endif()

############################
Expand Down

0 comments on commit b66298f

Please sign in to comment.