Merge pull request #385 from FabienPean/patch-2

Make building tests an option in CMake
This commit is contained in:
Sylvestre Ledru
2023-01-15 18:37:17 +01:00
committed by GitHub
+9 -5
View File
@@ -31,6 +31,7 @@ option(ICBEXMM "Enable support for matrix market example based on ICB" OFF)
option(PYTHON3 "Enable python3 support" OFF)
set(BOOST_PYTHON_LIBSUFFIX "" CACHE STRING "suffix to add to custom boost python libs")
option(EXAMPLES "Compile ARPACK examples" OFF)
option(TESTS "Compile ARPACK tests" ON)
# Suffixes: LIBSUFFIX modify ONLY libraries names, ITF64SUFFIX modify BOTH libraries AND include directory names.
set(LIBSUFFIX ""
@@ -621,11 +622,7 @@ endif()
############################
# TEST
############################
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)
@@ -782,6 +779,13 @@ if(ICB)
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()
############################
# install