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