PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/Servers/ServerManager/Testing/Python/CMakeLists.txt

https://github.com/kmorel/ParaView
CMake | 159 lines | 117 code | 20 blank | 22 comment | 0 complexity | 1215314e26ea480a64c380a4cb8ce58d MD5 | raw file
  1. # Requires that PVServerManagerTestData is set
  2. # for any of the tests to be added.
  3. ###############################################################################
  4. # For python test that simply load the SM state.
  5. #
  6. # To load state files in python and perform regression testing
  7. # add them here.
  8. SET (SMSTATE_FILES
  9. ${PYTHON_SMSTATE_FILES}
  10. )
  11. # In CMake version 2.8 we can used a much nicer $<CONFIGURATION> arguments for specifying
  12. # the configuration type of the build For now I have added this new functionality to these
  13. # batch tests but it will only work on dashboards using 2.8. This check can be removed when
  14. # ParaView officially requires CMake 2.8."
  15. SET(GENERATOR_EXPRESSIONS_SUPPORTED)
  16. IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
  17. SET(GENERATOR_EXPRESSIONS_SUPPORTED OFF)
  18. ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
  19. SET(GENERATOR_EXPRESSIONS_SUPPORTED ON)
  20. ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
  21. SET(PVPYTHON_COMMAND ${EXECUTABLE_OUTPUT_PATH}/pvpython)
  22. SET(PVBATCH_COMMAND ${EXECUTABLE_OUTPUT_PATH}/pvbatch)
  23. # We don't want the <CONFIGURATION> as part of the path on non windows systems.
  24. IF(WIN32 AND GENERATOR_EXPRESSIONS_SUPPORTED)
  25. SET(PVPYTHON_COMMAND ${EXECUTABLE_OUTPUT_PATH}/\$<CONFIGURATION>/pvpython)
  26. SET(PVBATCH_COMMAND ${EXECUTABLE_OUTPUT_PATH}/\$<CONFIGURATION>/pvbatch)
  27. ENDIF(WIN32 AND GENERATOR_EXPRESSIONS_SUPPORTED)
  28. IF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
  29. FOREACH (tfile ${SMSTATE_FILES})
  30. ADD_TEST(NAME "${tfile}-ServerManagerPython"
  31. COMMAND ${PVPYTHON_COMMAND}
  32. ${CMAKE_CURRENT_SOURCE_DIR}/SMPythonTesting.py
  33. -D ${PVServerManagerTestData}
  34. -T ${ParaView_BINARY_DIR}/Testing/Temporary
  35. -V ${PVServerManagerTestData}/Baseline/${tfile}.png
  36. --state ${SMSTATE_FILE_DIR}/${tfile}.pvsm)
  37. ENDFOREACH (tfile)
  38. # This is a test that saves a temporary SM state and uses that saved
  39. # state for regression testing.
  40. ADD_TEST(NAME "LoadSave-ServerManagerPython"
  41. COMMAND ${PVPYTHON_COMMAND}
  42. ${CMAKE_CURRENT_SOURCE_DIR}/SMPythonTesting.py
  43. -D ${PVServerManagerTestData}
  44. -T ${ParaView_BINARY_DIR}/Testing/Temporary
  45. -V ${PVServerManagerTestData}/Baseline/Arrow.png
  46. --state ${SMSTATE_FILE_DIR}/Arrow.pvsm
  47. --use_saved_state)
  48. ENDIF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
  49. ###############################################################################
  50. # For python scripts for testing.
  51. #
  52. # Add python script names here.
  53. SET (PY_TESTS
  54. Animation
  55. ProxyPropertyLinks
  56. PythonPVSimpleCone
  57. PythonPVSimpleExII
  58. PythonPVSimpleSphere
  59. PythonSMTraceTest1
  60. PythonSMTraceTest2
  61. # SMUndoRedo
  62. # SMCompoundProxyUndoRedo
  63. )
  64. IF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
  65. FOREACH (tfile ${PY_TESTS})
  66. ADD_TEST(NAME "${tfile}-ServerManagerPython"
  67. COMMAND ${PVPYTHON_COMMAND}
  68. ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
  69. -D ${PVServerManagerTestData}
  70. -T ${ParaView_BINARY_DIR}/Testing/Temporary
  71. -V ${PVServerManagerTestData}/Baseline/${tfile}.png
  72. -S ${SMSTATE_FILE_DIR})
  73. ENDFOREACH(tfile)
  74. ENDIF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
  75. SET(PY_TESTS_NO_BASELINE
  76. CellIntegrator
  77. CSVWriterReader
  78. IntegrateAttributes
  79. ProgrammableFilter
  80. ProxyManager
  81. SMPropertyAdaptor
  82. VRMLSource
  83. PythonFilters
  84. )
  85. IF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
  86. FOREACH (tfile ${PY_TESTS_NO_BASELINE})
  87. ADD_TEST(NAME "${tfile}-ServerManagerPython"
  88. COMMAND ${PVPYTHON_COMMAND}
  89. ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
  90. -D ${PVServerManagerTestData}
  91. -T ${ParaView_BINARY_DIR}/Testing/Temporary
  92. -S ${SMSTATE_FILE_DIR})
  93. ENDFOREACH(tfile)
  94. ENDIF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
  95. ###############################################################################
  96. # Add tests for pvbatch.
  97. SET (PVBATCH_TESTS
  98. Simple
  99. ParallelSerialWriter
  100. )
  101. IF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
  102. FOREACH (tfile ${PVBATCH_TESTS})
  103. IF (VTK_MPIRUN_EXE AND VTK_MPI_MAX_NUMPROCS GREATER 1)
  104. ADD_TEST(NAME ${tfile}-Batch
  105. COMMAND ${VTK_MPIRUN_EXE} ${VTK_MPI_PRENUMPROC_FLAGS} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS}
  106. ${PVBATCH_COMMAND}
  107. ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
  108. -D ${PVServerManagerTestData}
  109. -T ${ParaView_BINARY_DIR}/Testing/Temporary
  110. -V ${PVServerManagerTestData}/Baseline/${tfile}.png
  111. -S ${SMSTATE_FILE_DIR})
  112. ADD_TEST(NAME ${tfile}-SymmetricBatch
  113. COMMAND ${VTK_MPIRUN_EXE} ${VTK_MPI_PRENUMPROC_FLAGS} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS}
  114. ${PVBATCH_COMMAND}
  115. --symmetric
  116. ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
  117. -D ${PVServerManagerTestData}
  118. -T ${ParaView_BINARY_DIR}/Testing/Temporary
  119. -V ${PVServerManagerTestData}/Baseline/${tfile}.png
  120. -S ${SMSTATE_FILE_DIR})
  121. ELSE (VTK_MPIRUN_EXE AND VTK_MPI_MAX_NUMPROCS GREATER 1)
  122. ADD_TEST(NAME ${tfile}-Batch
  123. COMMAND ${PVBATCH_COMMAND}
  124. ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
  125. -D ${PVServerManagerTestData}
  126. -T ${ParaView_BINARY_DIR}/Testing/Temporary
  127. -V ${PVServerManagerTestData}/Baseline/${tfile}.png
  128. -S ${SMSTATE_FILE_DIR})
  129. ADD_TEST(NAME ${tfile}-SymmetricBatch
  130. COMMAND ${PVBATCH_COMMAND}
  131. --symmetric
  132. ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
  133. -D ${PVServerManagerTestData}
  134. -T ${ParaView_BINARY_DIR}/Testing/Temporary
  135. -V ${PVServerManagerTestData}/Baseline/${tfile}.png
  136. -S ${SMSTATE_FILE_DIR})
  137. ENDIF (VTK_MPIRUN_EXE AND VTK_MPI_MAX_NUMPROCS GREATER 1)
  138. ENDFOREACH (tfile)
  139. ENDIF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)