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