Merge topic 'cmake-guard-testing-directories'
b719911d1 cmake: use `if (TEST)` to detect tests that are enabled 4c7fe13a9 cmake: avoid adding testing directories if testing is disabled Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Vicente Bolea <vicente.bolea@kitware.com> Merge-request: !2508
This commit is contained in:
commit
7e576483cb
@ -112,10 +112,6 @@ endfunction()
|
||||
# backends at runtime.
|
||||
#
|
||||
function(vtkm_unit_tests)
|
||||
if (NOT VTKm_ENABLE_TESTING)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(options)
|
||||
set(global_options ${options} USE_VTKM_JOB_POOL MPI ALL_BACKENDS)
|
||||
set(oneValueArgs BACKEND NAME LABEL)
|
||||
|
@ -89,7 +89,9 @@ endif()
|
||||
add_subdirectory(thirdparty/optionparser)
|
||||
add_subdirectory(thirdparty/lcl)
|
||||
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
add_subdirectory(internal)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@ -311,4 +311,6 @@ if(TARGET vtkm_loguru)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -42,4 +42,6 @@ vtkm_declare_headers(${headers})
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -19,7 +19,7 @@ add_subdirectory(internal)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::cuda)
|
||||
if (TARGET vtkm::cuda AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
||||
|
@ -52,4 +52,6 @@ vtkm_declare_headers(${headers})
|
||||
# internal and which are part of the external interface.
|
||||
#add_custom_target(vtkmContInternal ALL DEPENDS vtkmCont)
|
||||
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -17,6 +17,6 @@ add_subdirectory(internal)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::kokkos)
|
||||
if (TARGET vtkm::kokkos AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
@ -17,6 +17,6 @@ add_subdirectory(internal)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::openmp)
|
||||
if (TARGET vtkm::openmp AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
@ -36,15 +36,16 @@ vtkm_unit_tests(SOURCES ${unit_tests}
|
||||
DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG
|
||||
LIBRARIES vtkm_worklet)
|
||||
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
#We need to have all OpenMP tests run serially as they
|
||||
#will uses all the system cores, and we will cause a N*N thread
|
||||
#explosion which causes the tests to run slower than when run
|
||||
#serially
|
||||
foreach (test ${unit_tests})
|
||||
get_filename_component(tname ${test} NAME_WE)
|
||||
set_tests_properties(${tname} PROPERTIES
|
||||
RUN_SERIAL True
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
#We need to have all OpenMP tests run serially as they
|
||||
#will uses all the system cores, and we will cause a N*N thread
|
||||
#explosion which causes the tests to run slower than when run
|
||||
#serially
|
||||
foreach (test ${unit_tests})
|
||||
if (NOT TEST "${test}")
|
||||
continue ()
|
||||
endif ()
|
||||
get_filename_component(tname ${test} NAME_WE)
|
||||
set_tests_properties(${tname} PROPERTIES
|
||||
RUN_SERIAL True
|
||||
)
|
||||
endforeach()
|
||||
|
@ -17,4 +17,6 @@ add_subdirectory(internal)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -17,6 +17,6 @@ add_subdirectory(internal)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::tbb)
|
||||
if (TARGET vtkm::tbb AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
@ -63,4 +63,6 @@ add_subdirectory(cuda)
|
||||
add_subdirectory(kokkos)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -49,4 +49,6 @@ vtkm_declare_headers(${headers})
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -25,6 +25,6 @@ set_source_files_properties(ThrustPatches.h
|
||||
PROPERTIES VTKm_CANT_BE_HEADER_TESTED TRUE)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::cuda)
|
||||
if (TARGET vtkm::cuda AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
@ -22,4 +22,6 @@ vtkm_declare_headers(${headers})
|
||||
|
||||
vtkm_pyexpander_generated_file(WorkletInvokeFunctorDetail.h)
|
||||
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -15,6 +15,6 @@ set(headers
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (VTKm_ENABLE_OPENMP)
|
||||
if (VTKm_ENABLE_OPENMP AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
@ -15,4 +15,6 @@ set(headers
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -15,6 +15,6 @@ set(headers
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::tbb)
|
||||
if (TARGET vtkm::tbb AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
@ -281,4 +281,6 @@ add_subdirectory(internal)
|
||||
add_subdirectory(particleadvection)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -88,4 +88,6 @@ vtkm_pyexpander_generated_file(FunctionInterfaceDetailPost.h)
|
||||
vtkm_pyexpander_generated_file(VariantImplDetail.h)
|
||||
vtkm_pyexpander_generated_file(VecOperators.h)
|
||||
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -17,6 +17,6 @@ vtkm_declare_headers(${headers})
|
||||
|
||||
add_subdirectory(internal)
|
||||
|
||||
if(VTKm_ENABLE_OPENGL_TESTS)
|
||||
if(VTKm_ENABLE_OPENGL_TESTS AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
@ -18,6 +18,6 @@ set(headers
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if(TARGET vtkm_rendering)
|
||||
if(TARGET vtkm_rendering AND VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
|
@ -98,4 +98,6 @@ endif()
|
||||
add_subdirectory(internal)
|
||||
add_subdirectory(reader)
|
||||
add_subdirectory(writer)
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -14,4 +14,6 @@ set(headers
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -155,4 +155,6 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(internal)
|
||||
add_subdirectory(raytracing)
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -30,4 +30,6 @@ vtkm_library(NAME vtkm_source
|
||||
target_link_libraries(vtkm_source PUBLIC vtkm_cont)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -158,4 +158,6 @@ target_link_libraries(vtkm_worklet PUBLIC vtkm_cont)
|
||||
set_source_files_properties(${sources_device} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
@ -19,4 +19,6 @@ set(headers
|
||||
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
add_subdirectory(testing)
|
||||
if (VTKm_ENABLE_TESTING)
|
||||
add_subdirectory(testing)
|
||||
endif ()
|
||||
|
Loading…
Reference in New Issue
Block a user