Commit eb4be53c authored by Bill Lorensen's avatar Bill Lorensen
Browse files

ENH: CXX tests should not fail if VTK_DATA_ROOT is missing.

The vtkTestingInteractor was trying to run regression tests even if
VTK_DATA_ROOT was not defined.

Many Testing/Cxx CMakeLists.txt files tried to run tests that required
input data, even though VTK_DATA_ROOT was not defined.

Subsequent topics will address Tcl and Python tests.

Change-Id: Iabf242f9f498ce044948ca1d4a29378b76ceb21d
parent 9fabcff5
# Tests with data
if(VTK_DATA_ROOT)
set(NEEDS_DATA
TestArrayCalculator
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${NEEDS_DATA}
TestGhostArray.cxx
# TestAppendPolyData.cxx
TestAppendSelection.cxx
TestArrayCalculator.cxx
TestAssignAttribute.cxx
TestCellDataToPointData.cxx
TestCenterOfMass.cxx
......
......@@ -8,17 +8,23 @@ set(MyTests
TestBooleanOperationPolyDataFilter2.cxx
TestDensifyPolyData.cxx
TestDistancePolyDataFilter.cxx
TestGradientAndVorticity.cxx
TestIconGlyphFilterGravity.cxx
TestImageDataToPointSet.cxx
TestIntersectionPolyDataFilter.cxx
TestIntersectionPolyDataFilter2.cxx
TestQuadraturePoints.cxx
TestRectilinearGridToPointSet.cxx
TestReflectionFilter.cxx
TestUncertaintyTubeFilter.cxx
TestYoungsMaterialInterface.cxx
)
# Tests with data
if(VTK_DATA_ROOT)
set(MyTests
${MyTests}
TestGradientAndVorticity.cxx
TestIconGlyphFilterGravity.cxx
TestQuadraturePoints.cxx
TestYoungsMaterialInterface.cxx
)
endif()
# Set the tolerance higher for a few tests that need it
set(TestDensifyPolyDataError 15)
......
# Tests with data
if(VTK_DATA_ROOT)
set(NEEDS_DATA
TestGenericStreamTracer.cxx
)
endif()
vtk_tests(BASELINEDIR GenericFiltering DATADIR ${VTK_DATA_ROOT}
${NEEDS_DATA}
TestGenericClip.cxx
TestGenericContourFilter.cxx
TestGenericCutter.cxx
......@@ -6,5 +13,4 @@ vtk_tests(BASELINEDIR GenericFiltering DATADIR ${VTK_DATA_ROOT}
TestGenericGeometryFilter.cxx
TestGenericGlyph3DFilter.cxx
TestGenericProbeFilter.cxx
TestGenericStreamTracer.cxx
otherCreation.cxx)
set(MyTests
TestCellDistanceSelector2D.cxx
TestCellDistanceSelector3D.cxx
TestLinearSelector2D.cxx
TestLinearSelector3D.cxx
)
# Tests with data
if(VTK_DATA_ROOT)
set(MyTests
${MyTests}
TestCellDistanceSelector2D.cxx
TestCellDistanceSelector3D.cxx
TestLinearSelector3D.cxx
)
endif()
# Use the testing object factory, to reduce boilerplate code in tests.
include(vtkTestingObjectFactory)
......
......@@ -15,8 +15,10 @@ 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})
endforeach()
if (VTK_DATA_ROOT)
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})
endforeach()
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
# Tests with data
if(VTK_DATA_ROOT)
set(NEEDS_DATA
TestProStarReader.cxx
TestSimplePointsReaderWriter.cxx
TestTecplotReader.cxx
TestWindBladeReader.cxx
TestAMRReadWrite.cxx
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${NEEDS_DATA}
TestSimplePointsReaderWriter.cxx
TestWindBladeReader.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
......
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
if(VTK_DATA_ROOT)
set (NEEDS_DATA
TestVRMLNormals.cxx
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${NEEDS_DATA}
EXTRA_INCLUDE vtkTestDriver.h
)
......
if(VTK_DATA_ROOT)
set (NEEDS_DATA
TestBiomTableReader.cxx
TestNewickTreeReader.cxx
TestMultiNewickTreeReader.cxx
TestTulipReaderProperties.cxx
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${NEEDS_DATA}
# TestTulipReader.cxx # todo (unsatisfied deps)
# TestTulipReaderClusters.cxx # todo (unsatisfied deps)
TestBiomTableReader.cxx
TestTulipReaderProperties.cxx
TestNewickTreeReader.cxx
TestMultiNewickTreeReader.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
......
......@@ -29,6 +29,8 @@ foreach(test ${TestsToRun})
-T ${VTK_TEST_OUTPUT_DIR}
-V Baseline/IO/${TName}.png)
else()
add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName})
add_test(NAME ${vtk-module}Cxx-${TName}
COMMAND ${vtk-module}CxxTests ${TName}
-T ${VTK_TEST_OUTPUT_DIR})
endif()
endforeach()
if(VTK_DATA_ROOT)
set (NEEDS_DATA
SLACMultipleModes.cxx
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
SLACMultipleModes.cxx
${NEEDS_DATA}
SLACParticleReader.cxx
SLACReaderLinear.cxx
SLACReaderQuadratic.cxx
......
if(VTK_DATA_ROOT)
set (NEEDS_DATA
TestAMRXMLIO.cxx
TestXMLHierarchicalBoxDataFileConverter.cxx
)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestAMRXMLIO.cxx
${NEEDS_DATA}
TestDataObjectXMLIO.cxx
TestXML.cxx
TestXMLHierarchicalBoxDataFileConverter.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
......
if(VTK_DATA_ROOT)
set (NEEDS_DATA TestStringToNumeric.cxx TestMergeTables.cxx)
endif()
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${NEEDS_DATA}
ArraySparseArrayToTable.cxx
ArrayTableToSparseArray.cxx
ArrayToTable.cxx
......@@ -10,12 +15,10 @@ create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestExtractSelectedGraph.cxx
TestGraphAlgorithms.cxx
TestMergeGraphs.cxx
TestMergeTables.cxx
TestPruneTreeFilter.cxx
TestRandomGraphSource.cxx
TestRemoveIsolatedVertices.cxx
TestStreamGraph.cxx
TestStringToNumeric.cxx
TestTableToArray.cxx
TestThresholdTable.cxx
# TestTimePoint.cxx # deprecated dep
......
......@@ -17,7 +17,6 @@ set(MyTests
TestCheckerboardWidget.cxx
TestConstrainedHandleWidget.cxx
TestContourWidget2.cxx
TestDijkstraGraphGeodesicPath.cxx
TestDijkstraImageGeodesicPath.cxx
TestDistanceWidget.cxx
TestDistanceWidget3D.cxx
......@@ -31,8 +30,6 @@ set(MyTests
TestImplicitPlaneWidget2.cxx
TestImplicitPlaneWidget2LockNormalToCamera.cxx
TestImplicitPlaneWidget2b.cxx
TestLineWidget.cxx
TestLineWidget2.cxx
TestLogoWidget.cxx
TestLogoWidgetAlphaBlending.cxx
TestLogoWidgetDepthPeeling.cxx
......@@ -41,14 +38,8 @@ set(MyTests
TestParallelopipedWidget.cxx
TestPickingManagerWidgets.cxx
TestPickingManagerSeedWidget.cxx
TestPlaneWidget.cxx
TestPlaybackWidget.cxx
TestPointHandleRepresentation3D.cxx
TestPointWidget.cxx
TestPolyPlane.cxx
TestPolygonalHandleRepresentations.cxx
TestPolygonalRepresentationHandleWidget.cxx
TestPolygonalSurfaceConstrainedDistanceWidget.cxx
TestProgrammaticPlacement.cxx
TestProp3DButtonRepresentation.cxx
TestRectilinearWipeWidget.cxx
......@@ -60,10 +51,7 @@ set(MyTests
TestSeedWidgetNonUniformRepresentations.cxx
TestSliderWidget.cxx
TestSliderWidget2D.cxx
TestSphereHandleWidget.cxx
# TestSplineWidget.cxx # todo (unsatistfied deps)
TestSurfaceConstrainedHandleWidget.cxx
TestTensorProbeWidget.cxx
TestTextWidget.cxx
vtkAngleRepresentation2DTest1.cxx
vtkAngleRepresentation3DTest1.cxx
......@@ -86,6 +74,25 @@ set(MyTests
vtkTextWidgetTest1.cxx
)
# Tests with data
if(VTK_DATA_ROOT)
set(MyTests
${MyTests}
TestDijkstraGraphGeodesicPath.cxx
TestLineWidget.cxx
TestLineWidget2.cxx
TestPlaneWidget.cxx
TestPointWidget.cxx
TestPolyPlane.cxx
TestPolygonalHandleRepresentations.cxx
TestPolygonalRepresentationHandleWidget.cxx
TestPolygonalSurfaceConstrainedDistanceWidget.cxx
TestSphereHandleWidget.cxx
TestSurfaceConstrainedHandleWidget.cxx
TestTensorProbeWidget.cxx
)
endif()
# Use the testing object factory, to reduce boilerplate code in tests.
include(vtkTestingObjectFactory)
......
......@@ -105,5 +105,5 @@ int TestSplitViewportStereoHorizontal(int argc, char *argv[])
retVal = vtkRegressionTester::PASSED;
}
return (retVal == vtkRegressionTester::PASSED) ? 0 : 1;
return (!retVal);
}
......@@ -3,12 +3,16 @@ set(MyTests "")
if(NOT APPLE)
# This is from the old build system - not working on Apple platform.
list(APPEND MyTests
TestImageDataLIC2D.cxx # This was segfaulting before modularization (and is now).
TestStructuredGridLIC2DXSlice.cxx
TestStructuredGridLIC2DYSlice.cxx
TestStructuredGridLIC2DZSlice.cxx
TestSurfaceLIC.cxx
)
if(VTK_DATA_ROOT)
list(APPEND MyTests
TestSurfaceLIC.cxx
TestImageDataLIC2D.cxx # This was segfaulting before modularization (and is now).
)
endif()
endif()
# Use the testing object factory, to reduce boilerplate code in tests.
......
......@@ -28,14 +28,12 @@ SET(RenderingTestsWithArguments
TestHomogeneousTransformOfActor.cxx
TestImageResliceMapperAlpha.cxx
TestImageResliceMapperBackground.cxx
TestImageResliceMapperBorder.cxx
TestImageResliceMapperInterpolation.cxx
TestImageResliceMapperOffAxis.cxx
TestImageResliceMapperOrient3D.cxx
TestImageResliceMapperSlab.cxx
TestImageSliceMapperAlpha.cxx
TestImageSliceMapperBackground.cxx
TestImageSliceMapperBorder.cxx
TestImageSliceMapperOrient2D.cxx
TestImageSliceMapperOrient3D.cxx
TestImageSliceMapperInterpolation.cxx
......@@ -96,6 +94,8 @@ if(VTK_DATA_ROOT)
TestMultiTexturing.cxx
TestMultiTexturingTransform.cxx
TestGlyph3DMapperArrow.cxx
TestImageSliceMapperBorder.cxx
TestImageResliceMapperBorder.cxx
TestScalarBar.cxx
TestScenePicker.cxx
TestTextureRGBA.cxx
......
......@@ -102,5 +102,5 @@ int TestOffAxisStereo(int argc, char *argv[])
retVal = vtkRegressionTester::PASSED;
}
return (retVal == vtkRegressionTester::PASSED) ? 0 : 1;
return (!retVal);
}
......@@ -4,8 +4,6 @@ set(MyTests
PartialPreIntegration.cxx
PreIntegrationIncremental.cxx
PreIntegrationNonIncremental.cxx
ProjectedTetrahedraZoomIn.cxx
TestFinalColorWindowLevel.cxx
TestFixedPointRayCastLightComponents.cxx
TestGPURayCastAdditive.cxx
TestGPURayCastCompositeBinaryMask.cxx
......@@ -15,27 +13,36 @@ set(MyTests
TestGPURayCastCompositeToMIP.cxx
TestGPURayCastCropping.cxx
TestGPURayCastDataTypesMIP.cxx
TestGPURayCastDataTypesMinIP.cxx
TestGPURayCastFourComponentsComposite.cxx
TestGPURayCastFourComponentsCompositeStreaming.cxx
TestGPURayCastFourComponentsMIP.cxx
TestGPURayCastFourComponentsMinIP.cxx
TestGPURayCastMIPBinaryMask.cxx
TestGPURayCastMIPToComposite.cxx
TestGPURayCastNearestDataTypesMIP.cxx
TestGPURayCastPerspectiveParallel.cxx
TestHAVSVolumeMapper.cxx
TestMinIntensityRendering.cxx
TestProjectedHexahedra.cxx
TestProjectedTetrahedra.cxx
TestProp3DFollower.cxx
TestSmartVolumeMapper.cxx
TestSmartVolumeMapperWindowLevel.cxx
TestTM3DLightComponents.cxx
ZsweepConcavities.cxx
volProt.cxx
)
# Tests with data
if(VTK_DATA_ROOT)
set(MyTests
${MyTests}
ProjectedTetrahedraZoomIn.cxx
TestFinalColorWindowLevel.cxx
TestGPURayCastNearestDataTypesMIP.cxx
TestGPURayCastDataTypesMinIP.cxx
TestHAVSVolumeMapper.cxx
TestMinIntensityRendering.cxx
TestProjectedTetrahedra.cxx
TestProp3DFollower.cxx
volProt.cxx
)
endif()
# Use the testing object factory, to reduce boilerplate code in tests.
include(vtkTestingObjectFactory)
......@@ -60,8 +67,10 @@ foreach(test ${TestsToRun})
endif()
endforeach()
set_tests_properties(${vtk-module}Cxx-TestProp3DFollower
PROPERTIES TIMEOUT 100)
if (VTK_DATA_ROOT)
set_tests_properties(${vtk-module}Cxx-TestProp3DFollower
PROPERTIES TIMEOUT 100)
endif()
set_tests_properties(${vtk-module}Cxx-TestTM3DLightComponents
PROPERTIES TIMEOUT 110)
......@@ -38,18 +38,23 @@ void vtkTestingInteractor::Start()
testing->AddArgument("-T");
testing->AddArgument(vtkTestingInteractor::TempDirectory.c_str());
// Location of the Data directory
testing->AddArgument("-D");
testing->AddArgument(vtkTestingInteractor::DataDirectory.c_str());
// Location of the Data directory. If NOTFOUND, suppress regression
// testing
if (vtkTestingInteractor::DataDirectory != "VTK_DATA_ROOT-NOTFOUND")
{
testing->AddArgument("-D");
testing->AddArgument(vtkTestingInteractor::DataDirectory.c_str());
// The name of the valid baseline image
testing->AddArgument("-V");
std::string valid = vtkTestingInteractor::ValidBaseline;
testing->AddArgument(valid.c_str());
// The name of the valid baseline image
testing->AddArgument("-V");
std::string valid = vtkTestingInteractor::ValidBaseline;
testing->AddArgument(valid.c_str());
// Regression test the image
vtkTestingInteractor::TestReturnStatus =
// Regression test the image
vtkTestingInteractor::TestReturnStatus =
testing->RegressionTest(vtkTestingInteractor::ErrorThreshold);
}
}
//----------------------------------------------------------------------------------
......
......@@ -6,7 +6,6 @@ set(MyTests
TestHeatmapOnly.cxx
TestHierarchicalGraphView.cxx
TestIcicleView.cxx
TestIconGlyphFilter.cxx
TestInteractorStyleTreeMapHover.cxx
TestNetworkViews.cxx
TestRenderView.cxx
......@@ -18,6 +17,10 @@ set(MyTests
${QtTests}
)
if( VTK_DATA_ROOT)
set(MyTests ${MyTests} TestIconGlyphFilter.cxx)
endif()
# Use the testing object factory, to reduce boilerplate code in tests.
include(vtkTestingObjectFactory)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment