Commit dffe6e6d authored by Bill Lorensen's avatar Bill Lorensen

ENH: New testing objects, vtkTestingObjectFactory and vtkTestingInteractor...

ENH: New testing objects, vtkTestingObjectFactory and vtkTestingInteractor facilitate consistent regression testing of VTK Cxx Tests and Examples. The changes in VTK/Examples permit the building of examples within the VTK build tree and externally.
parent 12e64ab5
PROJECT (AMR)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(HierarchicalBoxPipeline HierarchicalBoxPipeline.cxx)
TARGET_LINK_LIBRARIES(HierarchicalBoxPipeline vtkRendering vtkIO)
PROJECT (LabeledMesh)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE (${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
SET(Libraries vtkRendering)
......
PROJECT(Array)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
IF(NOT VTK_USE_N_WAY_ARRAYS)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_N_WAY_ARRAYS.")
......
......@@ -34,8 +34,11 @@ SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
# Find and load VTK settings.
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
# Give user option of building shared or static libraries. Default to
# the choice made for VTK.
......@@ -50,7 +53,7 @@ ELSE(BUILD_SHARED_LIBS)
SET(VTKLOCAL_BUILD_SHARED_LIBS_CONFIG 0)
ENDIF(BUILD_SHARED_LIBS)
IF(VTK_FOUND)
IF(VTK_BINARY_DIR)
# If this is a build tree, provide an option for putting this
# project's executables and libraries in with VTK's.
IF (EXISTS ${VTK_DIR}/bin)
......@@ -148,4 +151,4 @@ IF(VTK_FOUND)
ENDIF(VTK_WRAP_JAVA)
SUBDIRS(Testing)
ENDIF(VTK_FOUND)
ENDIF(VTK_BINARY_DIR)
......@@ -10,8 +10,10 @@ MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
#
# Try to find VTK and include its settings (otherwise complain)
#
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
#
# Build shared libs ?
......
PROJECT(VTKExamples)
# VTK examples now require CMake 2.4 or higher.
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
# Remove these policy lines when CMake 2.6 is the minimum version.
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
# Choose behavior based on whether we are building inside the VTK tree.
IF(VTK_BINARY_DIR)
# We are building in the VTK tree. Add tests for some examples.
# Test the build system examples. These tests can be run only
# when the configuration type is known when running the test.
IF(BUILD_TESTING AND VTK_TEST_CONFIG_TYPE_KNOWN)
# If multiple configuration types are available we must add the test
# in a way that will use the configuration given for testing. When
# CTest 2.2 and higher is used to drive the tests it evaluates the
# ADD_TEST commands stored in the test files using standard cmake
# language evaluation. The variable CTEST_CONFIGURATION_TYPE expands
# to the configuration specified for testing (Debug, Release, etc.).
# This variable must be stored in the test string and evaluated at
# testing time, so the dollar must be stored in a way that will not be
# evaluated immediately. In CMake 2.2 and higher this can be done
# with an escaped dollar but we must support older CMake versions
# syntactically.
IF(CMAKE_CONFIGURATION_TYPES)
# We need to pass the configuration type on the test command line.
SET(DOLLAR "$")
SET(VTK_EXAMPLE_TEST_CONFIG_TYPE -C "${DOLLAR}{CTEST_CONFIGURATION_TYPE}")
SET(VTK_EXAMPLE_TEST_RUN_DIR "${EXECUTABLE_OUTPUT_PATH}/${DOLLAR}{CTEST_CONFIGURATION_TYPE}")
ELSE(CMAKE_CONFIGURATION_TYPES)
# There is only one configuration type so it need not be passed.
SET(VTK_EXAMPLE_TEST_CONFIG_TYPE)
SET(VTK_EXAMPLE_TEST_RUN_DIR "${EXECUTABLE_OUTPUT_PATH}")
ENDIF(CMAKE_CONFIGURATION_TYPES)
# Add a test to build the vtkLocal example.
ADD_TEST(Example-vtkLocal ${CMAKE_CTEST_COMMAND}
${VTK_EXAMPLE_TEST_CONFIG_TYPE}
--build-and-test
${VTK_SOURCE_DIR}/Examples/Build/vtkLocal
${VTK_BINARY_DIR}/Examples/Build/vtkLocal
--build-two-config
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
--build-project VTKLOCAL
--build-run-dir ${VTK_EXAMPLE_TEST_RUN_DIR}
--build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
--test-command "${VTK_BINARY_DIR}/Examples/Build/vtkLocal/bin/vtkLocalTest"
)
# Add a test to build the vtkMy example.
ADD_TEST(Example-vtkMy ${CMAKE_CTEST_COMMAND}
${VTK_EXAMPLE_TEST_CONFIG_TYPE}
--build-and-test
${VTK_SOURCE_DIR}/Examples/Build/vtkMy
${VTK_BINARY_DIR}/Examples/Build/vtkMy
--build-two-config
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
--build-project VTKMY
--build-run-dir ${VTK_EXAMPLE_TEST_RUN_DIR}
--build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
--test-command "${VTK_BINARY_DIR}/Examples/Build/vtkMy/bin/vtkmyEx1"
)
ENDIF(BUILD_TESTING AND VTK_TEST_CONFIG_TYPE_KNOWN)
# Build the examples as a separate project using a custom target.
# Make sure it uses the same build configuration as VTK.
IF(CMAKE_CONFIGURATION_TYPES)
SET(VTKExamples_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}")
ELSE(CMAKE_CONFIGURATION_TYPES)
SET(VTKExamples_CONFIG_TYPE)
ENDIF(CMAKE_CONFIGURATION_TYPES)
# Only define these Apple specfic flags if for Apple machines
IF(APPLE)
SET(EXAMPLES_OSX_CMAKE_DEFINES "
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:STRING=${CMAKE_OSX_SYSROOT}")
ELSE(APPLE)
SET(EXAMPLES_OSX_CMAKE_DEFINES "")
ENDIF(APPLE)
ADD_CUSTOM_COMMAND(
OUTPUT ${VTK_BINARY_DIR}/VTKExamples
COMMAND ${CMAKE_CTEST_COMMAND}
ARGS ${VTKExamples_CONFIG_TYPE}
--build-and-test
${VTK_SOURCE_DIR}/Examples
${VTK_BINARY_DIR}/Examples/All
--build-noclean
--build-two-config
--build-project VTKExamples
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
--build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
${EXAMPLES_OSX_CMAKE_DEFINES}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_MINSIZEREL:STRING=${CMAKE_C_FLAGS_MINSIZEREL}
-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=${CMAKE_CXX_FLAGS_MINSIZEREL}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DEXECUTABLE_OUTPUT_PATH:PATH=${EXECUTABLE_OUTPUT_PATH}
-DLIBRARY_OUTPUT_PATH:PATH=${LIBRARY_OUTPUT_PATH}
)
ADD_CUSTOM_TARGET(VTKExamplesTarget ALL DEPENDS ${VTK_BINARY_DIR}/VTKExamples)
# Make sure the target builds after the rest of VTK.
ADD_DEPENDENCIES(VTKExamplesTarget
vtkCommon
vtkFiltering
vtkImaging
vtkGraphics
vtkGenericFiltering
vtkIO
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
# Most examples require rendering support.
IF(VTK_USE_RENDERING)
SUBDIRS(
Build/vtkLocal
Build/vtkMy
AMR/Cxx
Annotation/Cxx/LabeledMesh
Charts/Cxx
MultiBlock/Cxx
GUI/Motif
DataManipulation/Cxx
ImageProcessing/Cxx
IO/Cxx
Medical/Cxx
Modelling/Cxx
Rendering/Cxx
Tutorial/Step1/Cxx
Tutorial/Step2/Cxx
Tutorial/Step3/Cxx
Tutorial/Step4/Cxx
Tutorial/Step5/Cxx
Tutorial/Step6/Cxx
Widgets/Cxx
)
IF(VTK_USE_RENDERING)
ADD_DEPENDENCIES(VTKExamplesTarget vtkRendering)
ADD_DEPENDENCIES(VTKExamplesTarget vtkVolumeRendering)
ADD_DEPENDENCIES(VTKExamplesTarget vtkHybrid)
ADD_DEPENDENCIES(VTKExamplesTarget vtkWidgets)
ENDIF(VTK_USE_RENDERING)
IF(VTK_USE_PARALLEL)
ADD_DEPENDENCIES(VTKExamplesTarget vtkParallel)
IF(VTK_USE_PARALLEL)
SUBDIRS(ParallelProcessing)
ENDIF(VTK_USE_PARALLEL)
IF(VTK_USE_INFOVIS)
ADD_DEPENDENCIES(VTKExamplesTarget vtkInfovis)
SUBDIRS(Infovis/Cxx)
IF(VTK_USE_N_WAY_ARRAYS)
SUBDIRS(Array/Cxx)
ENDIF(VTK_USE_N_WAY_ARRAYS)
ENDIF(VTK_USE_INFOVIS)
IF(VTK_USE_VIEWS)
ADD_DEPENDENCIES(VTKExamplesTarget vtkViews)
ENDIF(VTK_USE_VIEWS)
IF(VTK_USE_QVTK)
ADD_DEPENDENCIES(VTKExamplesTarget QVTK)
IF(VTK_USE_QVTK)
SUBDIRS(GUI/Qt)
ENDIF(VTK_USE_QVTK)
IF(VTK_USE_MFC)
ADD_DEPENDENCIES(VTKExamplesTarget vtkMFC)
ENDIF(VTK_USE_MFC)
IF(VTK_USE_CHARTS)
ADD_DEPENDENCIES(VTKExamplesTarget vtkCharts)
ENDIF(VTK_USE_CHARTS)
ELSE(VTK_BINARY_DIR)
# We are building outside the VTK tree. Build the examples directly.
PROJECT(VTKExamples)
# Find and load the VTK configuration.
FIND_PACKAGE(VTK)
IF(NOT VTK_DIR)
MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
ENDIF(NOT VTK_DIR)
INCLUDE(${VTK_USE_FILE})
# Most examples require rendering support.
IF(VTK_USE_RENDERING)
SUBDIRS(
AMR/Cxx
Annotation/Cxx/LabeledMesh
MultiBlock/Cxx
GUI/Motif
DataManipulation/Cxx
ImageProcessing/Cxx
Medical/Cxx
Modelling/Cxx
Rendering/Cxx
Tutorial/Step1/Cxx
Tutorial/Step2/Cxx
Tutorial/Step3/Cxx
Tutorial/Step4/Cxx
Tutorial/Step5/Cxx
Tutorial/Step6/Cxx
Widgets/Cxx
)
IF(VTK_USE_PARALLEL)
SUBDIRS(ParallelProcessing)
ENDIF(VTK_USE_PARALLEL)
IF(VTK_USE_INFOVIS)
SUBDIRS(Infovis/Cxx)
IF(VTK_USE_N_WAY_ARRAYS)
SUBDIRS(Array/Cxx)
ENDIF(VTK_USE_N_WAY_ARRAYS)
ENDIF(VTK_USE_INFOVIS)
IF(VTK_USE_QVTK)
SUBDIRS(GUI/Qt)
ENDIF(VTK_USE_QVTK)
IF(VTK_USE_CHARTS)
SUBDIRS(Charts/Cxx)
ENDIF(VTK_USE_CHARTS)
IF(WIN32)
SUBDIRS(GUI/Win32/SimpleCxx)
IF(VTK_USE_MFC)
SUBDIRS(GUI/Win32/SampleMFC)
SUBDIRS(GUI/Win32/vtkMFC)
ENDIF(VTK_USE_MFC)
ENDIF(WIN32)
ENDIF(VTK_USE_RENDERING)
ENDIF(VTK_BINARY_DIR)
IF(WIN32)
SUBDIRS(GUI/Win32/SimpleCxx)
IF(VTK_USE_MFC)
SUBDIRS(GUI/Win32/SampleMFC)
SUBDIRS(GUI/Win32/vtkMFC)
ENDIF(VTK_USE_MFC)
ENDIF(WIN32)
ENDIF(VTK_USE_RENDERING)
PROJECT (Charts)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_CHARTS)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_CHARTS.")
ENDIF(NOT VTK_USE_CHARTS)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(GraphItem GraphItem.cxx vtkGraphItem.cxx)
......
PROJECT (DataManipulation)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Arrays Arrays.cxx)
ADD_EXECUTABLE(Cube Cube.cxx)
......
......@@ -16,11 +16,10 @@ TARGET_LINK_LIBRARIES(ParticleReader vtkHybrid)
SET(KIT IOExamples)
SET(MyTests TestDumpXMLFile.cxx TestParticleReader.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Examples/vtkTestingObjectFactory.cmake)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests}
${VTK_SOURCE_DIR}/Examples/vtkTestingObjectFactory.cxx)
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkWidgets)
IF (VTK_DATA_ROOT)
......
PROJECT(ImageProcessing)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(ImageSlicing ImageSlicing.cxx)
TARGET_LINK_LIBRARIES(ImageSlicing vtkRendering vtkImaging vtkIO)
######## Regression Testing ########
SET(KIT ImageProcessingExamples)
SET(MyTests TestImageSlicing.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering)
ADD_TEST(${KIT}-ImageSlicing ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestImageSlicing ${VTK_DATA_ROOT}/Data/headsq/quarter)
PROJECT(Infovis)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
......@@ -8,6 +9,7 @@ IF(NOT VTK_USE_INFOVIS)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_INFOVIS.")
ENDIF(NOT VTK_USE_INFOVIS)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(TreeLayout TreeLayout.cxx)
TARGET_LINK_LIBRARIES(TreeLayout vtkViews vtkInfovis vtkRendering vtkImaging vtkIO)
......
PROJECT (Medical)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Medical1 Medical1.cxx)
ADD_EXECUTABLE(Medical2 Medical2.cxx)
ADD_EXECUTABLE(Medical3 Medical3.cxx)
ADD_EXECUTABLE(Medical4 Medical4.cxx)
ADD_EXECUTABLE(GenerateModelsFromLabels GenerateModelsFromLabels.cxx)
ADD_EXECUTABLE(GenerateCubesFromLabels GenerateCubesFromLabels.cxx)
IF(VTK_USE_VOLUMERENDERING)
ADD_EXECUTABLE(Medical4 Medical4.cxx)
ENDIF(VTK_USE_VOLUMERENDERING)
TARGET_LINK_LIBRARIES(Medical1 vtkRendering vtkIO)
TARGET_LINK_LIBRARIES(Medical2 vtkRendering vtkIO)
TARGET_LINK_LIBRARIES(Medical3 vtkRendering vtkIO)
TARGET_LINK_LIBRARIES(GenerateModelsFromLabels vtkHybrid vtkIO)
TARGET_LINK_LIBRARIES(GenerateCubesFromLabels vtkHybrid vtkIO)
IF(VTK_USE_VOLUMERENDERING)
TARGET_LINK_LIBRARIES(Medical4 vtkVolumeRendering vtkIO)
ENDIF(VTK_USE_VOLUMERENDERING)
TARGET_LINK_LIBRARIES(Medical4 vtkVolumeRendering vtkIO)
######## Regression Testing ########
SET(KIT MedicalExamples)
SET(MyTests TestMedical1.cxx TestMedical2.cxx TestMedical3.cxx TestMedical4.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkWidgets vtkVolumeRendering)
ADD_TEST(${KIT}-Medical1 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestMedical1 ${VTK_DATA_ROOT}/Data/headsq/quarter)
ADD_TEST(${KIT}-Medical2 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestMedical2 ${VTK_DATA_ROOT}/Data/headsq/quarter)
ADD_TEST(${KIT}-Medical3 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestMedical3 ${VTK_DATA_ROOT}/Data/headsq/quarter)
ADD_TEST(${KIT}-Medical4 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestMedical4 ${VTK_DATA_ROOT}/Data/headsq/quarter)
PROJECT (finance)
PROJECT (Modelling)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(finance finance.cxx)
TARGET_LINK_LIBRARIES(finance vtkRendering)
ADD_EXECUTABLE(Delaunay3D Delaunay3D.cxx)
TARGET_LINK_LIBRARIES(Delaunay3D vtkHybrid)
ADD_EXECUTABLE(Delaunay3DAlpha Delaunay3DAlpha.cxx)
TARGET_LINK_LIBRARIES(Delaunay3DAlpha vtkHybrid)
######## Regression Testing ########
SET(KIT ModellingExamples)
SET(MyTests TestFinance.cxx TestDelaunay3D.cxx TestDelaunay3DAlpha.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkWidgets)
IF (VTK_DATA_ROOT)
ADD_TEST(${KIT}-Finance ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestFinance ${VTK_DATA_ROOT}/Data/financial.txt)
ADD_TEST(${KIT}-Delaunay3D ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestDelaunay3D
${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_BINARY_DIR}/Testing/Temporary/Delaunay3D.vtu)
ADD_TEST(${KIT}-Delaunay3DAlpa ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestDelaunay3DAlpha
.5 ${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_BINARY_DIR}/Testing/Temporary/Delaunay3DAlpha.vtu)
ENDIF (VTK_DATA_ROOT)
PROJECT (MultiBlock)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(MultiBlock MultiBlock.cxx)
TARGET_LINK_LIBRARIES(MultiBlock vtkRendering vtkIO)
PROJECT (Rendering)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
SET(RENDERING_EXAMPLES_SRCS
Cylinder
......
PROJECT (Step1)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Cone Cone.cxx)
TARGET_LINK_LIBRARIES(Cone vtkRendering)
PROJECT (Step2)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Cone2 Cone2.cxx)
TARGET_LINK_LIBRARIES(Cone2 vtkRendering)
PROJECT (Step3)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Cone3 Cone3.cxx)
TARGET_LINK_LIBRARIES(Cone3 vtkRendering)
PROJECT (Step4)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Cone4 Cone4.cxx)
TARGET_LINK_LIBRARIES(Cone4 vtkRendering)
PROJECT (Step5)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Cone5 Cone5.cxx)
TARGET_LINK_LIBRARIES(Cone5 vtkRendering)
PROJECT (Step6)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Cone6 Cone6.cxx)
TARGET_LINK_LIBRARIES(Cone6 vtkWidgets)
PROJECT (Widgets)
ENABLE_TESTING()
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Slider Slider.cxx)
TARGET_LINK_LIBRARIES(Slider vtkRendering vtkWidgets)
......@@ -20,21 +21,11 @@ TARGET_LINK_LIBRARIES(BalloonWidget vtkRendering vtkWidgets)
SET(KIT WidgetsExamples)
SET(MyTests TestSlider.cxx TestSlider2D.cxx TestBalloonWidget.cxx)
SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN
" vtkTestingObjectFactory* factory = vtkTestingObjectFactory::New();
vtkObjectFactory::RegisterFactory(factory);
factory->Delete();"
)
SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN
" vtkObjectFactory::UnRegisterFactory(factory);"
)
CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx ${MyTests}
EXTRA_INCLUDE ${VTK_SOURCE_DIR}/Examples/vtkTestingObjectFactory.h)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests}
${VTK_SOURCE_DIR}/Examples/vtkTestingObjectFactory.cxx)
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkWidgets)
ADD_TEST(Examples-Slider ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests TestSlider)
ADD_TEST(Examples-Slider2D ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests TestSlider2D)
ADD_TEST(Examples-BalloonWidget ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests TestBalloonWidget)
ADD_TEST(${KIT}-Slider ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests TestSlider)
ADD_TEST(${KIT}-Slider2D ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests TestSlider2D)
ADD_TEST(${KIT}-BalloonWidget ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests TestBalloonWidget)
SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN
"
vtkTestingObjectFactory* factory = vtkTestingObjectFactory::New();
vtkObjectFactory::RegisterFactory(factory);
factory->Delete();
vtkTestingInteractor::TestName=vtkstd::string(cmakeGeneratedFunctionMapEntries[testToRun].name);;
vtkTestingInteractor::TempDirectory=vtkstd::string(\"${VTK_BINARY_DIR}/Testing/Temporary\");
vtkTestingInteractor::BaselineDirectory=vtkstd::string(\"${VTK_DATA_ROOT}\") + vtkstd::string(\"/Baseline/\") + vtkstd::string(\"${KIT}\");
"
)
SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN
"
if (vtkTestingInteractor::TestReturnStatus != -1)
{
if( vtkTestingInteractor::TestReturnStatus != 1)
{
result = EXIT_FAILURE;
}
else
{
result = EXIT_SUCCESS;
}
vtkObjectFactory::UnRegisterFactory(factory);
}
"
)
CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx ${MyTests}
EXTRA_INCLUDE ${VTK_SOURCE_DIR}/Examples/vtkTestingObjectFactory.h)
/*=========================================================================
Program: Visualization Toolkit
Module: vtkTestingObjectFactory.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkTestingObjectFactory.h"
#include "vtkTesting.h"
#include "vtkSmartPointer.h"
#include "vtkRenderWindow.h"
#include "vtkPNGWriter.h"
#include "vtkWindowToImageFilter.h"
vtkCxxRevisionMacro(vtkTestingInteractor, "1.2");
vtkCxxRevisionMacro(vtkTestingObjectFactory, "1.2");
int vtkTestingInteractor::TestReturnStatus = -1;
vtkstd::string vtkTestingInteractor::TestName;
vtkstd::string vtkTestingInteractor::TempDirectory;
vtkstd::string vtkTestingInteractor::BaselineDirectory;