mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Remove VTK-m TestBuild infrastructure
The purpose of the TestBuild infrastructure was to confirm that VTK-m didn't have any lexical issues when it was a pure header only project. As we now move to have more compiled components the need for this form of testing is mitigated. Combined with the issue of TestBuilds causing MSVC issues, we should just remove this infrastructure.
This commit is contained in:
parent
5cf2a21d3c
commit
4ec5bae02d
@ -96,86 +96,6 @@ function(vtkm_compile_as_cuda output)
|
||||
set(${output} ${_cuda_srcs} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
function(vtkm_add_header_build_test name dir_prefix use_cuda)
|
||||
set(hfiles ${ARGN})
|
||||
|
||||
#only attempt to add a test build executable if we have any headers to
|
||||
#test. this might not happen when everything depends on thrust.
|
||||
list(LENGTH hfiles num_srcs)
|
||||
if (${num_srcs} EQUAL 0)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(ext "cxx")
|
||||
if(use_cuda)
|
||||
set(ext "cu")
|
||||
endif()
|
||||
|
||||
set(srcs)
|
||||
foreach (header ${hfiles})
|
||||
get_source_file_property(cant_be_tested ${header} VTKm_CANT_BE_HEADER_TESTED)
|
||||
if( NOT cant_be_tested )
|
||||
string(REPLACE "/" "_" headername "${header}")
|
||||
string(REPLACE "." "_" headername "${headername}")
|
||||
set(src ${CMAKE_CURRENT_BINARY_DIR}/TB_${headername}.${ext})
|
||||
|
||||
#By using file generate we will not trigger CMake execution when
|
||||
#a header gets touched
|
||||
file(GENERATE
|
||||
OUTPUT ${src}
|
||||
CONTENT "
|
||||
//mark that we are including headers as test for completeness.
|
||||
//This is used by headers that include thrust to properly define a proper
|
||||
//device backend / system
|
||||
#define VTKM_TEST_HEADER_BUILD
|
||||
#include <${dir_prefix}/${header}>
|
||||
int ${headername}_${headerextension}_testbuild_symbol;"
|
||||
)
|
||||
|
||||
list(APPEND srcs ${src})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set_source_files_properties(${hfiles}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE
|
||||
)
|
||||
|
||||
if(TARGET TestBuild_${name})
|
||||
#If the target already exists just add more sources to it
|
||||
target_sources(TestBuild_${name} PRIVATE ${srcs})
|
||||
else()
|
||||
add_library(TestBuild_${name} STATIC ${srcs} ${hfiles})
|
||||
# Send the libraries created for test builds to their own directory so as to
|
||||
# not pollute the directory with useful libraries.
|
||||
set_property(TARGET TestBuild_${name} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${VTKm_LIBRARY_OUTPUT_PATH}/testbuilds)
|
||||
set_property(TARGET TestBuild_${name} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${VTKm_LIBRARY_OUTPUT_PATH}/testbuilds)
|
||||
|
||||
target_link_libraries(TestBuild_${name}
|
||||
PRIVATE
|
||||
$<BUILD_INTERFACE:vtkm_developer_flags>
|
||||
vtkm_compiler_flags
|
||||
vtkm_taotuple
|
||||
)
|
||||
|
||||
if(TARGET vtkm::tbb)
|
||||
#make sure that we have the tbb include paths when tbb is enabled.
|
||||
target_link_libraries(TestBuild_${name} PRIVATE vtkm::tbb)
|
||||
endif()
|
||||
|
||||
if(TARGET vtkm_diy)
|
||||
target_link_libraries(TestBuild_${name} PRIVATE vtkm_diy)
|
||||
endif()
|
||||
|
||||
if(TARGET vtkm_rendering_gl_context)
|
||||
target_link_libraries(TestBuild_${name} PRIVATE vtkm_rendering_gl_context)
|
||||
endif()
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
function(vtkm_generate_export_header lib_name)
|
||||
# Get the location of this library in the directory structure
|
||||
@ -229,36 +149,15 @@ endfunction(vtkm_install_headers)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
function(vtkm_declare_headers)
|
||||
#TODO: look at the testable and cuda options
|
||||
set(options CUDA)
|
||||
set(oneValueArgs TESTABLE)
|
||||
set(multiValueArgs EXCLUDE_FROM_TESTING)
|
||||
set(oneValueArgs)
|
||||
set(multiValueArgs)
|
||||
cmake_parse_arguments(VTKm_DH "${options}"
|
||||
"${oneValueArgs}" "${multiValueArgs}"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
#The testable keyword allows the caller to turn off the header testing,
|
||||
#mainly used so that backends can be installed even when they can't be
|
||||
#built on the machine.
|
||||
#Since this is an optional property not setting it means you do want testing
|
||||
if(NOT DEFINED VTKm_DH_TESTABLE)
|
||||
set(VTKm_DH_TESTABLE ON)
|
||||
endif()
|
||||
|
||||
set(hfiles ${VTKm_DH_UNPARSED_ARGUMENTS} ${VTKm_DH_EXCLUDE_FROM_TESTING})
|
||||
vtkm_get_kit_name(name dir_prefix)
|
||||
|
||||
#only do header testing if enable testing is turned on
|
||||
if (VTKm_ENABLE_TESTING AND VTKm_DH_TESTABLE)
|
||||
set_source_files_properties(${VTKm_DH_EXCLUDE_FROM_TESTING}
|
||||
PROPERTIES VTKm_CANT_BE_HEADER_TESTED TRUE
|
||||
)
|
||||
|
||||
vtkm_add_header_build_test(
|
||||
"${name}" "${dir_prefix}" "${VTKm_DH_CUDA}" ${hfiles})
|
||||
endif()
|
||||
|
||||
vtkm_install_headers("${dir_prefix}" ${hfiles})
|
||||
endfunction(vtkm_declare_headers)
|
||||
|
||||
|
@ -75,8 +75,6 @@ vtkm_pyexpander_generated_file(Math.h)
|
||||
vtkm_declare_headers(
|
||||
${headers}
|
||||
${template_sources}
|
||||
EXCLUDE_FROM_TESTING
|
||||
${template_sources}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@ -26,7 +26,7 @@ set(headers
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(internal)
|
||||
vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA})
|
||||
vtkm_declare_headers(CUDA ${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::cuda)
|
||||
|
@ -33,7 +33,7 @@ set(headers
|
||||
VirtualObjectTransferCuda.h
|
||||
)
|
||||
|
||||
vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA})
|
||||
vtkm_declare_headers(CUDA ${headers})
|
||||
|
||||
|
||||
if (TARGET vtkm::cuda)
|
||||
|
@ -24,7 +24,7 @@ set(headers
|
||||
|
||||
add_subdirectory(internal)
|
||||
|
||||
vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_OPENMP})
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::openmp)
|
||||
|
@ -32,7 +32,7 @@ set(headers
|
||||
VirtualObjectTransferOpenMP.h
|
||||
)
|
||||
|
||||
vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_OPENMP})
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#These sources need to always be built
|
||||
target_sources(vtkm_cont PRIVATE
|
||||
|
@ -24,7 +24,7 @@ set(headers
|
||||
|
||||
add_subdirectory(internal)
|
||||
|
||||
vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_TBB})
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::tbb)
|
||||
|
@ -29,11 +29,10 @@ set(headers
|
||||
VirtualObjectTransferTBB.h
|
||||
)
|
||||
|
||||
vtkm_declare_headers(ParallelSortTBB.hxx
|
||||
parallel_sort.h
|
||||
TESTABLE OFF)
|
||||
|
||||
vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_TBB})
|
||||
vtkm_declare_headers(${headers}
|
||||
ParallelSortTBB.hxx
|
||||
parallel_sort.h
|
||||
)
|
||||
|
||||
#These sources need to always be built
|
||||
target_sources(vtkm_cont PRIVATE
|
||||
|
@ -53,8 +53,9 @@ set(header_impls
|
||||
add_subdirectory(internal)
|
||||
add_subdirectory(arg)
|
||||
|
||||
vtkm_declare_headers(${headers})
|
||||
vtkm_declare_headers(${header_impls} TESTABLE OFF)
|
||||
vtkm_declare_headers(${headers}
|
||||
${header_impls}
|
||||
)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@ -28,7 +28,7 @@ set(headers
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA})
|
||||
vtkm_declare_headers(CUDA ${headers})
|
||||
|
||||
set_source_files_properties(ThrustPatches.h
|
||||
PROPERTIES VTKm_CANT_BE_HEADER_TESTED TRUE)
|
||||
|
@ -133,9 +133,7 @@ set(header_template_sources
|
||||
ZFPDecompressor3D.hxx
|
||||
)
|
||||
|
||||
vtkm_declare_headers(${headers}
|
||||
EXCLUDE_FROM_TESTING ${header_template_sources}
|
||||
)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
add_subdirectory(internal)
|
||||
|
||||
|
@ -24,7 +24,7 @@ set(headers
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
vtkm_declare_headers(${headers} TESTABLE FALSE)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
if(VTKm_ENABLE_TESTING AND TARGET vtkm_rendering)
|
||||
add_subdirectory(testing)
|
||||
|
@ -23,7 +23,7 @@ set(headers
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
vtkm_declare_headers(CUDA ${headers} TESTABLE FALSE)
|
||||
vtkm_declare_headers(CUDA ${headers})
|
||||
|
||||
add_subdirectory(internal)
|
||||
|
||||
|
@ -24,4 +24,4 @@ set(headers
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Disable test builds because we'd need to link OpenGL libraries.
|
||||
vtkm_declare_headers(CUDA ${headers} TESTABLE FALSE)
|
||||
vtkm_declare_headers(CUDA ${headers})
|
||||
|
@ -25,7 +25,7 @@ set(headers
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
vtkm_declare_headers(${headers} TESTABLE FALSE)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if(TARGET vtkm_rendering)
|
||||
|
@ -22,7 +22,7 @@ set(headers
|
||||
TestingOpenGLInterop.h
|
||||
TestingTransferFancyHandles.h
|
||||
)
|
||||
vtkm_declare_headers(${headers} TESTABLE FALSE)
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
|
||||
if(NOT TARGET GLUT::GLUT)
|
||||
|
@ -115,8 +115,9 @@ add_subdirectory(wavelets)
|
||||
add_subdirectory(particleadvection)
|
||||
add_subdirectory(zfp)
|
||||
|
||||
vtkm_declare_headers(${headers})
|
||||
vtkm_declare_headers(${header_impls} TESTABLE OFF)
|
||||
vtkm_declare_headers(${headers}
|
||||
${header_impls}
|
||||
)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@ -86,7 +86,6 @@ set(extra_headers
|
||||
#1. vtkm_declare_headers will do a flat install into the current respective
|
||||
# build directory
|
||||
vtkm_get_kit_name(name dir_prefix)
|
||||
vtkm_add_header_build_test(${name} ${dir_prefix} FALSE ${extra_headers})
|
||||
vtkm_install_headers("${dir_prefix}/freudenthal_2D" freudenthal_2D/Types.h)
|
||||
vtkm_install_headers("${dir_prefix}/freudenthal_3D" freudenthal_3D/Types.h)
|
||||
vtkm_install_headers("${dir_prefix}/marchingcubes_3D" marchingcubes_3D/Types.h)
|
||||
|
Loading…
Reference in New Issue
Block a user