Updates will be applied April 15th at 12pm EDT (UTC-0400). GitLab could be a little slow between 12 - 12:45pm EDT.

Commit 5b018861 authored by Brad King's avatar Brad King

Use vtk_add_test_cxx function

Refactor */*/Testing/Cxx/CMakeLists.txt to use the vtk_add_test_cxx
function instead of direct add_test calls.

Change-Id: I73dee627fa87a399c48b409af046b116fc75a0fd
parent ef7f0191
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestUsePiston
EXTRA_INCLUDE vtkTestDriver.h
vtk_add_test_cxx(AcceleratorsPiston
TestUsePiston.cxx
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
string (REPLACE "vtk" "" _baselinedname ${vtk-module})
# Add all the executables
foreach(test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if(VTK_DATA_ROOT)
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/${_baselinedname}/${TName}.png)
else()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName})
endif()
endforeach()
vtk_test_cxx_executable(${vtk-module}CxxTests)
if(VTK_DATA_ROOT AND (VTK_MPI_MAX_NUMPROCS GREATER 1))
find_package(MPI REQUIRED)
......
# if we have rendering and views add the following tests
# add tests that do not require data
set(MyTests
# add tests that do not require data
vtk_add_test_cxx(NO_DATA NO_VALID
TestContextScene.cxx
TestControlPointsItem.cxx
TestControlPointsItemEvents.cxx
)
if(VTK_DATA_ROOT)
if(VTK_DATA_ROOT)
# add tests that require data
set(MyTests ${MyTests}
vtk_add_test_cxx(Charts
TestAxes.cxx
TestBarGraph.cxx
TestBarGraphHorizontal.cxx
TestColorTransferFunction.cxx
TestColorTransferFunction.cxx,-E80
TestChartMatrix.cxx
TestChartsOn3D.cxx
TestChartsOn3D.cxx,-E16
TestChartXYZ.cxx
TestContext.cxx
TestContextImage.cxx
TestControlPointsHandleItem.cxx
TestControlPointsHandleItem.cxx,-E30
TestDiagram.cxx
TestHistogram2D.cxx
TestInteractiveChartXYZ.cxx
TestLegendHiddenPlots.cxx
TestLinePlot.cxx
TestLinePlot.cxx,-E25
TestLinePlot3D.cxx
TestLinePlotAxisFonts.cxx
TestLinePlot2.cxx
TestLinePlotInteraction.cxx
TestLinePlot2.cxx,-E25
TestLinePlotInteraction.cxx,-E25
TestLinePlotSelection.cxx
TestLinePlotSelection2.cxx
TestMultipleChartRenderers.cxx
TestMultipleRenderers.cxx
TestMultipleScalarsToColors.cxx
TestParallelCoordinates.cxx
TestMultipleRenderers.cxx,-E25
TestMultipleScalarsToColors.cxx,-E25
TestParallelCoordinates.cxx,-E15
TestPieChart.cxx
TestPlotMatrix.cxx
TestScalarsToColors.cxx
......@@ -46,43 +45,6 @@
TestStackedPlot.cxx
TestSurfacePlot.cxx
)
# Set the tolerance higher for a few tests that need it
set(TestGLSLError 12)
set(TestChartsOn3DError 16)
set(TestLinePlotError 25)
set(TestLinePlot2Error 25)
set(TestLinePlotInteractionError 25)
set(TestMultipleRenderersError 25)
set(TestMultipleScalarsToColorsError 25)
set(TestParallelCoordinatesError 15)
set(TestControlPointsHandleItemError 30)
set(TestColorTransferFunctionError 80)
endif()
endif()
# Use the testing object factory, to reduce boilerplate code in tests.
include(vtkTestingObjectFactory)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun CxxTests.cxx)
# Add all the executables
foreach(test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if(VTK_DATA_ROOT)
if(${${TName}Error})
set(_error_threshold ${${TName}Error})
else()
set(_error_threshold 10)
endif()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/Charts/${TName}.png
-E ${_error_threshold})
else()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName})
endif()
endforeach()
vtk_test_cxx_executable(${vtk-module}CxxTests RENDERING_FACTORY)
set(CommonColorTests
vtk_add_test_cxx(Common
TestCategoricalColors.cxx
TestNamedColors.cxx
)
)
if (VTK_DATA_ROOT)
set(CommonColorTestsWithArgs
vtk_add_test_cxx(Common
TestColorSeries.cxx
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${CommonColorTests}
${CommonColorTestsWithArgs}
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Add all the executables
foreach (test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if (VTK_DATA_ROOT)
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/Common/${TName}.png)
else()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName})
endif()
endforeach()
vtk_test_cxx_executable(${vtk-module}CxxTests)
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
# Tell TestSystemInformation where to find the build trees.
set(TestSystemInformation_ARGS ${CMAKE_BINARY_DIR})
# Tell TestXMLFileOutputWindow where to write test file
set(TestXMLFileOutputWindow_ARGS ${CMAKE_BINARY_DIR}/Testing/Temporary/XMLFileOutputWindow.txt)
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestArrayAPI.cxx
TestArrayAPIConvenience.cxx
TestArrayAPIDense.cxx
......@@ -46,24 +52,7 @@ create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
#otherLookupTable.cxx
#otherLookupTableWithEnabling.cxx
otherStringArray.cxx
)
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests}
vtk_test_cxx_executable(${vtk-module}CxxTests
vtkTestNewVar.cxx)
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Tell TestSystemInformation where to find the build trees.
set(TestSystemInformation_ARGS ${CMAKE_BINARY_DIR})
# Tell TestXMLFileOutputWindow where to write test file
set(TestXMLFileOutputWindow_ARGS ${CMAKE_BINARY_DIR}/Testing/Temporary/XMLFileOutputWindow.txt)
# Add all the executables
foreach(test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
add_test(NAME ${vtk-module}-${TName} COMMAND ${vtk-module}CxxTests ${TName} ${${TName}_ARGS})
endforeach()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestColor.cxx
TestVector.cxx
TestVectorOperators.cxx
......@@ -40,17 +40,5 @@ create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestPlane.cxx
TestStructuredData.cxx
TestDataObjectTypes.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Add all the executables
foreach (test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName})
endforeach()
)
vtk_test_cxx_executable(${vtk-module}CxxTests)
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
vtk_add_test_cxx(NO_DATA NO_VALID
TestCopyAttributeData.cxx
TestImageDataToStructuredGrid.cxx
TestSetInputDataObject.cxx
TestTemporalSupport.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Add all the executables
foreach (test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if(VTK_DATA_ROOT)
add_test(NAME ${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/${vtk-module}/${TName}.png)
else()
add_test(NAME ${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-T ${VTK_TEST_OUTPUT_DIR}
)
endif()
endforeach()
vtk_test_cxx_executable(${vtk-module}CxxTests)
set(Test_SRCS
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestAmoebaMinimizer.cxx
TestMatrix3x3.cxx
TestPolynomialSolversUnivariate.cxx
TestQuaternion.cxx
)
)
if(NOT VTK_LEGACY_REMOVE)
list(APPEND Test_SRCS
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestFastNumericConversion.cxx
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${Test_SRCS}
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Add all the executables
foreach (test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName})
endforeach()
vtk_test_cxx_executable(${vtk-module}CxxTests)
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestPolygonBuilder.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Add all the executables
foreach (test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName})
endforeach()
vtk_add_test_cxx(TestPolygonBuilder.cxx NO_DATA NO_VALID NO_OUTPUT)
vtk_test_cxx_executable(${vtk-module}CxxTests)
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestDirectory.cxx
otherTimerLog.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Add all the executables
foreach (test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
add_test(NAME ${TName} COMMAND ${vtk-module}CxxTests ${TName})
endforeach()
)
vtk_test_cxx_executable(${vtk-module}CxxTests)
set(MyTests
vtk_add_test_cxx(Chemistry
TestBallAndStick.cxx
TestPDBBallAndStick.cxx
TestBondColorModeDiscreteByAtom.cxx
......@@ -20,36 +20,7 @@ set(MyTests
# Tests with data
if(VTK_DATA_ROOT)
set(MyTests
${MyTests}
TestCMLMoleculeReader.cxx
)
vtk_add_test_cxx(TestCMLMoleculeReader.cxx Chemistry)
endif()
# Use the testing object factory, to reduce boilerplate code in tests.
include(vtkTestingObjectFactory)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun CxxTests.cxx)
# Add all the executables
foreach(test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if(VTK_DATA_ROOT)
if(${${TName}Error})
set(_error_threshold ${${TName}Error})
else()
set(_error_threshold 10)
endif()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/Chemistry/${TName}.png
-E ${_error_threshold})
else()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName})
endif()
endforeach ()
vtk_test_cxx_executable(${vtk-module}CxxTests RENDERING_FACTORY)
## List all test sources
set(MyTests
TestAMRGhostLayerStripping.cxx
TestAMRBlanking.cxx
TestAMRIterator.cxx
TestImageToAMR.cxx
set(tests
TestAMRGhostLayerStripping
TestAMRBlanking
TestAMRIterator
TestImageToAMR
)
## Create test source list
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${MyTests}
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
## Add all executables
foreach(test ${TestsToRun})
get_filename_component(t ${test} NAME_WE)
add_test(NAME ${vtk-module}Cxx-${t}
COMMAND ${vtk-module}CxxTests ${t} -D ${VTK_DATA_ROOT})
set_tests_properties(${vtk-module}Cxx-${t} PROPERTIES FAIL_REGULAR_EXPRESSION "Error")
foreach(t ${tests})
vtk_add_test_cxx(${t}.cxx NO_VALID NO_OUTPUT)
set_property(TEST ${vtk-module}Cxx-${t} PROPERTY FAIL_REGULAR_EXPRESSION "Error")
endforeach()
vtk_test_cxx_executable(${vtk-module}CxxTests)
# Tests with data
if(VTK_DATA_ROOT)
set(NEEDS_DATA
TestArrayCalculator
vtk_add_test_cxx(Graphics
TestArrayCalculator.cxx
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${NEEDS_DATA}
vtk_add_test_cxx(Graphics
TestGhostArray.cxx
# TestAppendPolyData.cxx
TestAppendSelection.cxx
......@@ -20,25 +19,5 @@ create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestImplicitPolyDataDistance.cxx
TestCutter.cxx
TestThreshold.cxx
EXTRA_INCLUDE vtkTestDriver.h)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Add all the executables
foreach(test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if(VTK_DATA_ROOT)
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/Graphics/${TName}.png)
else()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName})
endif()
endforeach()
\ No newline at end of file
)
vtk_test_cxx_executable(${vtk-module}CxxTests)
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
vtk_add_test_cxx(Graphics
TestConvertSelection.cxx
TestExtractSelection.cxx
TestExtraction.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Add all the executables
foreach(test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if(VTK_DATA_ROOT)
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/Graphics/${TName}.png)
else()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName})
endif()
endforeach()
)
vtk_test_cxx_executable(${vtk-module}CxxTests)
set(MyTests
vtk_add_test_cxx(Graphics
TestBSPTree.cxx
TestStreamTracer
TestAMRInterpolatedVelocityField
TestParticleTracers
TestStreamTracer.cxx
TestAMRInterpolatedVelocityField.cxx
TestParticleTracers.cxx
)
include(vtkTestingObjectFactory)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun CxxTests.cxx)
# Add all the executables
foreach (test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if(VTK_DATA_ROOT)
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/Graphics/${TName}.png)
else()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-T ${VTK_TEST_OUTPUT_DIR}
)
endif()
endforeach()
vtk_test_cxx_executable(${vtk-module}CxxTests RENDERING_FACTORY)
set(MyTests
vtk_add_test_cxx(Graphics
TestGraphWeightEuclideanDistanceFilter.cxx
BoxClipPolyData.cxx
BoxClipTetrahedra.cxx
......@@ -10,7 +10,7 @@ set(MyTests
TestContourTriangulatorCutter.cxx
TestContourTriangulatorMarching.cxx
TestDeformPointSet.cxx
TestDensifyPolyData.cxx
TestDensifyPolyData.cxx,-E15
TestDistancePolyDataFilter.cxx
TestImageDataToPointSet.cxx
TestIntersectionPolyDataFilter.cxx
......@@ -18,11 +18,11 @@ set(MyTests
TestRectilinearGridToPointSet.cxx
TestReflectionFilter.cxx
TestUncertaintyTubeFilter.cxx
)
)
# Tests with data
if(VTK_DATA_ROOT)
set(MyTests
${MyTests}
vtk_add_test_cxx(Graphics
TestGradientAndVorticity.cxx
TestIconGlyphFilterGravity.cxx
TestQuadraturePoints.cxx
......@@ -30,34 +30,4 @@ if(VTK_DATA_ROOT)
)
endif()
# Set the tolerance higher for a few tests that need it
set(TestDensifyPolyDataError 15)
# Use the testing object factory, to reduce boilerplate code in tests.
include(vtkTestingObjectFactory)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun CxxTests.cxx)
# Add all the executables
foreach(test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
if(VTK_DATA_ROOT)
if(${${TName}Error})
set(_error_threshold ${${TName}Error})
else()
set(_error_threshold 10)
endif()
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-D ${VTK_DATA_ROOT}
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/Graphics/${TName}.png