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  HTGPlotSelectionOverTime.xml
95  HyperTreeGridVisibleLeavesSize.xml
96  PlotOverLine_htg.xml # needs find data
97  ProgrammableFilterFieldData.xml
98  PythonCalculator.xml
99  PythonCalculatorArrayAssociation.xml
100  PythonCalculatorAutocomplete.xml
101  PythonCalculatorCrossComposite.xml
102  PythonCalculatorFieldData.xml
103  PythonCalculatorInput.xml
104  PythonCalculatorMultiline.xml
105  )
106 
107  set(SpreadSheetSelectionTrace_DISABLE_CS TRUE)
108  set(SpreadSheetSelectionTrace_DISABLE_CRS TRUE)
109 
110  list(APPEND TESTS_WITH_INLINE_COMPARES
111  FindDataTrace.xml
112  FindDataQueries.xml
113  TestTableFFT.xml # needs programmable filter + numpy
114  )
115 
116  # PythonAlgorithm plugin tests.
117  configure_file(
118  "PythonAlgorithmPlugin.xml.in"
119  "${CMAKE_CURRENT_BINARY_DIR}/PythonAlgorithmPlugin.xml" @ONLY)
120  configure_file(
121  "PythonAlgorithmReadersAndWriters.xml.in"
122  "${CMAKE_CURRENT_BINARY_DIR}/PythonAlgorithmReadersAndWriters.xml" @ONLY)
123 
124  set(pyalgo_plugin_tests
125  PythonAlgorithmPlugin
126  PythonAlgorithmReadersAndWriters)
127  foreach(tname IN LISTS pyalgo_plugin_tests)
128  list(APPEND TESTS_WITH_BASELINES
129  ${CMAKE_CURRENT_BINARY_DIR}/${tname}.xml)
130 
131  # we need to extend testing infrastructure to better support
132  # loading plugins in client-server. At that point, we can test these as well.
133  set(${tname}_DISABLE_CS TRUE)
134  set(${tname}_DISABLE_CRS TRUE)
135  endforeach()
136 endif()
137 
138 #----------------------------------------------------------------------
139 # Tests that produce some output (other than rendered images) from ParaView
140 # that should be checked for correctness. These work by executing an XML
141 # test in the UI that produces some output, then pvpython runs a Python script
142 # that checks the file for correctness. Example use: checking a CSV
143 # file for expected content.
144 #
145 # Tests listed here are required to define the following files:
146 # - <test>.xml - XML test script to play in the uI
147 # - <test>Verify.py - Python code to verify output saved out in the XML
148 # script
149 #----------------------------------------------------------------------
150 set(paraview_python_verify_tests
151  ExportMultiblockFieldDataSpreadsheet
152  ExportSceneSpreadSheetView
153 )
154 
155 if (PARAVIEW_ENABLE_WEB)
156  list(APPEND paraview_python_verify_tests
157  AnimatedExportScene
158  )
159 endif()
160 
162  foreach(test_name ${paraview_python_verify_tests})
163  set(tname "ParaView::Applications::${test_name}")
164  add_test(NAME ${tname}
165  COMMAND ${CMAKE_COMMAND}
166  -DPARAVIEW_EXECUTABLE:FILEPATH=$<TARGET_FILE:ParaView::paraview>
167  -DPVPYTHON_EXECUTABLE:FILEPATH=$<TARGET_FILE:ParaView::pvpython>
168  -DDATA_DIR:PATH=${paraview_test_data_directory_output}
169  -DTEST_NAME:STRING=${test_name}
170  -DTEST_SCRIPT:FILEPATH=${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.xml
171  -DTEST_VERIFIER:FILEPATH=${CMAKE_CURRENT_SOURCE_DIR}/${test_name}Verify.py
172  -DTEMPORARY_DIR:PATH=${CMAKE_BINARY_DIR}/Testing/Temporary
173  -P ${CMAKE_CURRENT_SOURCE_DIR}/PythonScriptTestDriver.cmake
174  )
175  set_tests_properties(${tname} PROPERTIES LABELS "paraview")
176  endforeach()
177 endif()
data
function find_python_module(module_name, result)
#define PARAVIEW_USE_PYTHON
Definition: moc_predefs.h:262