CMakeLists.txt 6.28 KB
Newer Older
1
SET(RenderingTests
Ken Martin's avatar
Ken Martin committed
2
  otherCoordinate.cxx
3
  TestPriorityStreaming.cxx
4
5
  )

6
7
8
9
10
INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
)

VTK Developers's avatar
VTK Developers committed
11
12
13
14
15
16
17
# For tests that actually use a vtkRenderWindow
SET(RenderingTestsWithArguments
  LoadOpenGLExtension.cxx
  TestActorLightingFlag.cxx
  TestAnimationScene.cxx
  TestBackfaceCulling.cxx
  TestBlurAndSobelPasses.cxx
18
  TestDynamic2DLabelMapper.cxx
VTK Developers's avatar
VTK Developers committed
19
20
21
22
23
24
25
26
27
28
  TestFBO.cxx
  TestFollowerPicking.cxx
  TestGaussianBlurPass.cxx
  TestGlyph3DMapper.cxx
  TestGlyph3DMapperMasking.cxx
  TestGlyph3DMapperOrientationArray.cxx
  TestGlyph3DMapperPicking.cxx
  TestGPUInfo.cxx
  TestGradientBackground.cxx
  TestHomogeneousTransformOfActor.cxx
29
30
31
32
33
34
  TestImageResliceMapperAlpha.cxx
  TestImageResliceMapperBackground.cxx
  TestImageResliceMapperInterpolation.cxx
  TestImageResliceMapperOffAxis.cxx
  TestImageResliceMapperOrient3D.cxx
  TestImageResliceMapperSlab.cxx
VTK Developers's avatar
VTK Developers committed
35
36
37
38
39
  TestImageSliceMapperAlpha.cxx
  TestImageSliceMapperBackground.cxx
  TestImageSliceMapperOrient2D.cxx
  TestImageSliceMapperOrient3D.cxx
  TestImageSliceMapperInterpolation.cxx
40
  TestImageStack.cxx
41
  TestInteractorStyleImageProperty.cxx
VTK Developers's avatar
VTK Developers committed
42
  TestInteractorTimers.cxx
43
44
45
46
47
  TestLabelPlacer.cxx
  TestLabelPlacer2D.cxx
  TestLabelPlacerCoincidentPoints.cxx
  TestLabelPlacementMapper2D.cxx
  TestLabelPlacementMapperCoincidentPoints.cxx
VTK Developers's avatar
VTK Developers committed
48
49
50
51
52
53
54
55
  TestLightActor.cxx
  TestLODActor.cxx
  TestManyActors.cxx
  TestOffAxisStereo.cxx
  TestOrderedTriangulator.cxx
  TestOpacity.cxx
  TestOpenGLPolyDataMapper.cxx
  TestOSConeCxx.cxx
56
  TestPolygonSelection.cxx
VTK Developers's avatar
VTK Developers committed
57
58
59
  TestPOVExporter.cxx
  TestResetCameraVerticalAspectRatio.cxx
  TestResetCameraVerticalAspectRatioParallel.cxx
60
  TestSetImageOrientation.cxx
VTK Developers's avatar
VTK Developers committed
61
62
63
64
65
66
67
68
69
  TestSobelGradientMagnitudePass.cxx
  TestShadowMapPass.cxx
  TestTextActorAlphaBlending.cxx
  TestTextActorDepthPeeling.cxx
  TestTextActor3DAlphaBlending.cxx
  TestTextActor3DDepthPeeling.cxx
  TestTexturedBackground.cxx
  TestTextureSize.cxx
  TestTDx.cxx
70
  TestTilingCxx.cxx
VTK Developers's avatar
VTK Developers committed
71
72
73
74
75
76
77
78
  TestTransformCoordinateUseDouble.cxx
  TestTranslucentLUTAlphaBlending.cxx
  TestTranslucentLUTDepthPeeling.cxx
  TestTranslucentLUTDepthPeelingPass.cxx
  TestTranslucentLUTTextureAlphaBlending.cxx
  TestTranslucentLUTTextureDepthPeeling.cxx
  )

79
80
81
82
if(APPLE)
  list(REMOVE_ITEM RenderingTestsWithArguments TestShadowMapPass.cxx)
endif()

VTK Developers's avatar
VTK Developers committed
83
84
if(WIN32 AND NOT VTK_USE_X)
  set(RenderingTestsWithArguments
Ken Martin's avatar
Ken Martin committed
85
    ${RenderingTestsWithArguments}
VTK Developers's avatar
VTK Developers committed
86
    TestWin32OpenGLRenderWindow.cxx
87
    )
VTK Developers's avatar
VTK Developers committed
88
endif()
89

90
91
include_directories(${OPENGL_INCLUDE_DIR})

VTK Developers's avatar
VTK Developers committed
92
93
94
95
if(VTK_DATA_ROOT)
  set(RenderingTestsWithArguments
    ${RenderingTestsWithArguments}
    TestAreaSelections.cxx
96
97
    TestGlyph3DMapperArrow.cxx
    TestMultiblockDisplayProperties.cxx
VTK Developers's avatar
VTK Developers committed
98
99
    TestMultiTexturing.cxx
    TestMultiTexturingTransform.cxx
100
101
    TestImageSliceMapperBorder.cxx
    TestImageResliceMapperBorder.cxx
102
    TestScalarBar.cxx
VTK Developers's avatar
VTK Developers committed
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
    TestScenePicker.cxx
    TestTextureRGBA.cxx
    TestTextureRGBADepthPeeling.cxx
    TestTranslucentImageActorAlphaBlending.cxx
    TestTranslucentImageActorDepthPeeling.cxx
    TestTStripsColorsTCoords.cxx
    TestTStripsNormalsColorsTCoords.cxx
    TestTStripsNormalsTCoords.cxx
    TestTStripsTCoords.cxx
    )
endif()

if(VTK_USE_DISPLAY AND VTK_DATA_ROOT)
  set(RenderingTestsWithArguments
    ${RenderingTestsWithArguments}
    RenderNonFinite.cxx
    SurfacePlusEdges.cxx
    TestLabelPlacementMapper.cxx
    )
endif()

124
set(VTK_USE_GLSL_SHADERS TRUE)
VTK Developers's avatar
VTK Developers committed
125
126
127
128
129
130
131
132
133
if(VTK_USE_GLSL_SHADERS)
  # Tests testing GLSL Shaders.
  set(RenderingTestsWithArguments
    ${RenderingTestsWithArguments}
    TestGenericVertexAttributesGLSLCxx.cxx
    TestGenericVertexAttributesGLSLAlphaBlending.cxx
    TestGenericVertexAttributesGLSLDepthPeelingPass.cxx
    )
endif()
134

VTK Developers's avatar
VTK Developers committed
135
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
Ken Martin's avatar
Ken Martin committed
136
  ${RenderingTests};${RenderingTestsWithArguments}
137
  EXTRA_INCLUDE vtkTestDriver.h
138
  )
Ken Martin's avatar
Ken Martin committed
139

VTK Developers's avatar
VTK Developers committed
140
set(TEST_FBO_IMPLEMENTATION_EXE
141
  TestFBOImplementation)
VTK Developers's avatar
VTK Developers committed
142
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestFBOInclude.h.in
143
144
145
146
147
148
  ${CMAKE_CURRENT_BINARY_DIR}/TestFBOInclude.h
  @ONLY IMMEDIATE ESCAPE_QUOTES)

# This is used by TestFBO. Using a separate processes makes is possible to
# avoid issues to OpenGL implementations segfaulting etc. from affecting the
# test.
VTK Developers's avatar
VTK Developers committed
149
vtk_module_test_executable(TestFBOImplementation
150
  TestFBOImplementation.cxx)
VTK Developers's avatar
VTK Developers committed
151
152
target_link_libraries(TestFBOImplementation
  vtkRenderingOpenGL ${OPENGL_gl_LIBRARY})
153

VTK Developers's avatar
VTK Developers committed
154
155
156
if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY)
  target_link_libraries(TestFBOImplementation ${OSMESA_LIBRARY})
endif()
157

VTK Developers's avatar
VTK Developers committed
158
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
159

VTK Developers's avatar
VTK Developers committed
160
161
162
if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY)
  target_link_libraries(${vtk-module}CxxTests ${OSMESA_LIBRARY})
endif()
Ken Martin's avatar
Ken Martin committed
163

VTK Developers's avatar
VTK Developers committed
164
set(TestsToRun ${Tests})
165
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
Ken Martin's avatar
Ken Martin committed
166

167
# Add all the executables
VTK Developers's avatar
VTK Developers committed
168
169
170
171
foreach(test ${RenderingTests})
  get_filename_component(TName ${test} NAME_WE)
  add_test(NAME ${vtk-module}Cxx-${TName}
    COMMAND ${vtk-module}CxxTests ${TName}
172
      -T ${VTK_TEST_OUTPUT_DIR}
173
    )
VTK Developers's avatar
VTK Developers committed
174
endforeach()
Ken Martin's avatar
Ken Martin committed
175

VTK Developers's avatar
VTK Developers committed
176
177
178
179
180
foreach(test ${RenderingTestsWithArguments})
  get_filename_component(TName ${test} NAME_WE)
  if(VTK_DATA_ROOT)
    add_test(NAME ${vtk-module}Cxx-${TName}
      COMMAND ${vtk-module}CxxTests ${TName}
Ken Martin's avatar
Ken Martin committed
181
        -D ${VTK_DATA_ROOT}
182
        -T ${VTK_TEST_OUTPUT_DIR}
VTK Developers's avatar
VTK Developers committed
183
184
185
186
        -V Baseline/Rendering/${TName}.png)
  else()
    add_test(NAME ${vtk-module}Cxx-${TName}
      COMMAND ${vtk-module}CxxTests ${TName}
187
        -T ${VTK_TEST_OUTPUT_DIR}
188
      )
VTK Developers's avatar
VTK Developers committed
189
190
  endif()
endforeach()
Ken Martin's avatar
Ken Martin committed
191

Ken Martin's avatar
Ken Martin committed
192
# Add other odd tests or executables
VTK Developers's avatar
VTK Developers committed
193
194
195
196
197
198
199
200
foreach(exe
  TimeRenderer
  TimeRenderer2
  VTKBenchMark
  )
  add_executable(${exe} ${exe}.cxx)
  target_link_libraries(${exe}
    vtkRenderingOpenGL
201
    vtkRenderingFreeTypeOpenGL
VTK Developers's avatar
VTK Developers committed
202
203
204
205
206
207
208
209
210
211
212
213
    vtkInteractionStyle
    vtkImagingSources
    vtkImagingGeneral
    vtkIOCore
    ${OPENGL_gl_LIBRARY})
  if(APPLE)
    target_link_libraries(${exe} "-framework GLUT")
  endif()
  if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY)
    target_link_libraries(${exe} ${OSMESA_LIBRARY})
  endif()
endforeach()
214

215
216
217
218
219
if(VTK_USE_GLSL_SHADERS)
  set_tests_properties(
    ${vtk-module}Cxx-TestGenericVertexAttributesGLSLDepthPeelingPass
    PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR:.*vtkOpenGLProperty.*Couldn't build the shader program. At this point , it can be an error in a shader or a driver bug.")
endif()
220
221
222
223
224

set_tests_properties(${vtk-module}Cxx-TestOpacity
  PROPERTIES TIMEOUT 70)
set_tests_properties(${vtk-module}Cxx-TestTextureSize
  PROPERTIES TIMEOUT 90)