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