test.python.cmake
Go to the documentation of this file.
1 # Tests that require python
2 
3 list(APPEND TESTS_WITHOUT_BASELINES
4  AllPropertiesSaveStatePython.xml
5  FullNotation.xml
6  IconBrowser.xml
7  MacroEditor.xml
8  ProgrammableSourcePythonEditorLink.xml
9  PythonDefaultLoadState.xml
10  PythonDefaultSaveState.xml
11  PythonEditorTab.xml
12  PythonResetSessionMacro.xml
13  SpreadSheetNullArrayName.xml # needs programmable filter
14  PythonCameraLinkSaveState.xml
15  PythonTraceSaveState.xml
16  # TestPopOutWidget.xml
17  TestPythonConsole.xml
18  TraceIntegrateVariables.xml
19  )
20 
21 # This test rely on copy being Ctrl-C
22 if(NOT APPLE)
23  list(APPEND TEST_WITHOUT_BASELINES_CLIENT_ONLY
24  TooltipCopy.xml
25  TooltipHideInfo.xml
26  TestHTGHoverOnCell.xml
27  )
28 endif()
29 
30 # VTTKJS exporter requires the Web module
31 if (PARAVIEW_ENABLE_WEB)
32  list (APPEND TESTS_WITHOUT_BASELINES
33  ExportToVTKJS.xml
34  ExportToVTKJSWithArraySelection.xml
35  )
36  set (ExportToVTKJS_FORCE_SERIAL TRUE) # since this uses popup-menu
37 endif ()
38 
39 list(APPEND TESTS_WITH_BASELINES
40  AutoSaveState.xml
41  ColorByComponentNames.xml # needs programmable filter
42  CopyPasteTrace.xml
43  LiveProgrammableSource.xml
44  LinkRenderViews.xml
45  LinkViews.xml
46  PythonShellRunScript.xml
47  PythonEditorRun.xml
48  SaveLoadStatePython.xml
49  SaveLoadStateSelectionPython.xml
50  TraceExodus.xml
51  TraceExportAndSaveData.xml
52  TraceSaveGeometry.xml
53  # TraceStatisticsFilter.xml (see paraview/paraview#20661. Also was disabled in CS/CRS mode)
54  TraceSupplementalProxiesFully.xml
55  TraceTimeControls.xml
56  TraceWithoutRenderingComponents.xml
57  )
58 # Surface selection unstable on CRS mode
59 set(SaveLoadStateSelectionPython_DISABLE_CRS TRUE)
60 
61 set (AutoSaveState_FORCE_SERIAL TRUE) # since this modifies settings
62 
63 list(APPEND TESTS_WITH_INLINE_COMPARES
64  RestoreArrayDefaultTransferFunction.xml
65  RestoreDefaultTransferFunction.xml
66  SelectCellsTrace.xml
67  SelectionLinkScripting.xml
68  SelectPointsTrace.xml
69  SplitViewTrace.xml
70  TraceMultiViews.xml
71  )
72 set(SelectCellsTrace_DISABLE_CRS TRUE)
73 set(SelectPointsTrace_DISABLE_CRS TRUE)
74 
75 # Check that matplotlib is available
76 include(ParaViewFindPythonModules)
77 find_python_module(matplotlib matplotlib_found)
78 if (matplotlib_found)
79  list(APPEND TESTS_WITH_BASELINES TestPythonView.xml)
80  list(APPEND TESTS_WITH_INLINE_COMPARES TextSourceInteriorLines.xml)
81  list(APPEND TESTS_WITH_INLINE_COMPARES TextSourcesInChartViews.xml)
82  list(APPEND TESTS_WITH_INLINE_COMPARES MathTextColumn.xml)
83 endif()
84 
85 find_python_module(numpy numpy_found)
86 if (numpy_found)
87  list(APPEND TESTS_WITH_BASELINES
88  AnnotateNotSanitizedArray.xml
89  ContextViewSelectionTrace.xml
90  FindDataNameSanitization.xml
91  FindDataNonDistributedData.xml
92  FindDataPartialArrays.xml
93  FindDataSelectLocationMultiblock.xml # find data needs python/numpy
94  FindDataSelectLocation.xml # find data needs python/numpy
95  FindDataSelectors.xml
96  FindDataTime.xml
97  ForceTimeDiamond.xml
98  FreezeQueryMultiblock.xml
99  IndexedLookupInitialization.xml # needs Python Calculator/numpy
100  PythonCalculatorNamedInputs.xml
101  PlotOverLine_surface.xml # needs find data
102  ProgrammableAnnotation.xml
103  SelectionSaveStatePVSM.xml # find data needs python/numpy
104  SelectionSaveStatePython.xml # find data needs python/numpy
105  SpreadSheetSelectionTrace.xml
106  StructuredGridCellBlanking.xml
107  VolumeNoMapScalars.xml # needs programmable filter + numpy
108  )
109 
110  # Selection non-functional on CRS mode
111  set(SelectionSaveStatePVSM_DISABLE_CRS TRUE)
112 
113  # Test without baselines and could only run in built-in mode.
114  list(APPEND TEST_WITHOUT_BASELINES_CLIENT_ONLY
115  BoundsDomainInitialization.xml # uses numpy wrapping in programmable filter
116  HyperTreeGridGenerateFields.xml
117  HTGPlotSelectionOverTime.xml
118  MultipleNumberOfComponents.xml
119  ProgrammableFilterFieldData.xml
120  PythonCalculatorInput.xml
121  )
122 
123  list(APPEND TESTS_WITHOUT_BASELINES
124  ExpressionChooser.xml
125  ExpressionClear.xml
126  FieldDataDomainDefault.xml
127  PlotOverLine_htg.xml # needs find data
128  PythonCalculator.xml
129  PythonCalculatorArrayAssociation.xml
130  PythonCalculatorAutocomplete.xml
131  PythonCalculatorCrossComposite.xml
132  PythonCalculatorFieldData.xml
133  PythonCalculatorMultiline.xml
134  SelectionAndAutoSaveState.xml
135  )
136 
137  set(SpreadSheetSelectionTrace_DISABLE_CS TRUE)
138  set(SpreadSheetSelectionTrace_DISABLE_CRS TRUE)
139 
140  list(APPEND TESTS_WITH_INLINE_COMPARES
141  ExodusModeShapes.xml
142  FindDataTrace.xml
143  FindDataQueries.xml
144  TestTableFFT.xml # needs programmable filter + numpy
145  )
146 
147  # PythonAlgorithm plugin tests.
148  configure_file(
149  "PythonAlgorithmPlugin.xml.in"
150  "${CMAKE_CURRENT_BINARY_DIR}/PythonAlgorithmPlugin.xml" @ONLY)
151  configure_file(
152  "PythonAlgorithmReadersAndWriters.xml.in"
153  "${CMAKE_CURRENT_BINARY_DIR}/PythonAlgorithmReadersAndWriters.xml" @ONLY)
154 
155  set(pyalgo_plugin_tests
156  PythonAlgorithmPlugin
157  PythonAlgorithmReadersAndWriters)
158  foreach(tname IN LISTS pyalgo_plugin_tests)
159  list(APPEND TESTS_WITH_BASELINES
160  ${CMAKE_CURRENT_BINARY_DIR}/${tname}.xml)
161 
162  # we need to extend testing infrastructure to better support
163  # loading plugins in client-server. At that point, we can test these as well.
164  set(${tname}_DISABLE_CS TRUE)
165  set(${tname}_DISABLE_CRS TRUE)
166  endforeach()
167 endif()
168 
169 #----------------------------------------------------------------------
170 # Tests that produce some output (other than rendered images) from ParaView
171 # that should be checked for correctness. These work by executing an XML
172 # test in the UI that produces some output, then pvpython runs a Python script
173 # that checks the file for correctness. Example use: checking a CSV
174 # file for expected content.
175 #
176 # Tests listed here are required to define the following files:
177 # - <test>.xml - XML test script to play in the uI
178 # - <test>Verify.py - Python code to verify output saved out in the XML
179 # script
180 #----------------------------------------------------------------------
181 set(paraview_python_verify_tests
182  ExportMultiblockFieldDataSpreadsheet
183  ExportSceneSpreadSheetView
184 )
185 
186 if (PARAVIEW_ENABLE_WEB)
187  list(APPEND paraview_python_verify_tests
188  AnimatedExportScene
189  )
190 endif()
191 
192 if (PARAVIEW_USE_PYTHON)
193  foreach(test_name ${paraview_python_verify_tests})
194  set(tname "ParaView::Applications::${test_name}")
195  add_test(NAME ${tname}
196  COMMAND ${CMAKE_COMMAND}
197  -DPARAVIEW_EXECUTABLE:FILEPATH=$<TARGET_FILE:ParaView::paraview>
198  -DPVPYTHON_EXECUTABLE:FILEPATH=$<TARGET_FILE:ParaView::pvpython>
199  -DDATA_DIR:PATH=${paraview_test_data_directory_output}
200  -DTEST_NAME:STRING=${test_name}
201  -DTEST_SCRIPT:FILEPATH=${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.xml
202  -DTEST_VERIFIER:FILEPATH=${CMAKE_CURRENT_SOURCE_DIR}/${test_name}Verify.py
203  -DTEMPORARY_DIR:PATH=${CMAKE_BINARY_DIR}/Testing/Temporary
204  -P ${CMAKE_CURRENT_SOURCE_DIR}/PythonScriptTestDriver.cmake
205  )
206  set_tests_properties(${tname} PROPERTIES LABELS "paraview")
207  endforeach()
208 endif()
data
function find_python_module(module_name, result)