Commit db30e7d7 authored by Meng ZHU's avatar Meng ZHU

CMakeLists.txt modified for Python Programmable filter.

ParaView/Servers/ServerManager/Testing/Python/CMakeLists.txt is modified
to handle specially for PythonFilters.py which tests the Python
programmable filter functionality. The modification adds PythonFilters.py
to the test list, it also makes the ctest system parses the outputs of
PythonFilters.py for regular expression that contains "Error". The reason
for this special behavior is that the programmable filter back end
constructs Python scripts on the fly after it receives input expressions.
If there is any error in the input expressisons, the errors or exceptions
that are caused when the constructed script is run, will not be catched
by the constructing environment. So even the test fail, there is no way
to inform ctest about it since the exception is not catchable. The only
possible way is to let ctest parse the outputs and when it sees anything
containing "Error", assuming that the test failed. Of course, this is not
comprehensive, for example, if "Warning" is thrown, ctest will not detect
it. However, given the constraints, this is the best can be done.
parent aae9d06e
......@@ -105,6 +105,13 @@ IF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
-T ${ParaView_BINARY_DIR}/Testing/Temporary
-S ${SMSTATE_FILE_DIR})
ENDFOREACH(tfile)
# This is necessary because PythonFilters generates and executes python scripts
# on the fly which throws exceptions but cannot be caught by the host script
# for some reason. Therefore, those exceptions are not considered as failures
# by the ctest framework. Set this property causes ctest to parse the outputs of
# the generated scripts for the regex "Error" which can cause a test failure.
set_tests_properties(PythonFilters-ServerManagerPython PROPERTIES FAIL_REGULAR_EXPRESSION "Error")
ENDIF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
###############################################################################
# Add tests for pvbatch.
......@@ -112,6 +119,7 @@ ENDIF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
SET (PVBATCH_TESTS
Simple
ParallelSerialWriter
PythonFilters
)
IF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
......@@ -155,5 +163,13 @@ IF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
-S ${SMSTATE_FILE_DIR})
ENDIF (VTK_MPIRUN_EXE AND VTK_MPI_MAX_NUMPROCS GREATER 1)
ENDFOREACH (tfile)
# This is necessary because PythonFilters generates and executes python scripts
# on the fly which throws exceptions but cannot be caught by the host script
# for some reason. Therefore, those exceptions are not considered as failures
# by the ctest framework. Set this property causes ctest to parse the outputs of
# the generated scripts for the regex "Error" which can cause a test failure.
set_tests_properties(PythonFilters-Batch PROPERTIES FAIL_REGULAR_EXPRESSION "Error")
set_tests_properties(PythonFilters-SymmetricBatch PROPERTIES FAIL_REGULAR_EXPRESSION "Error")
ENDIF (PVServerManagerTestData AND GENERATOR_EXPRESSIONS_SUPPORTED)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment