diff --git a/Modules/Wrappers/SWIG/test/python/CMakeLists.txt b/Modules/Wrappers/SWIG/test/python/CMakeLists.txt index 203a20a6d2eea6eb071ace10275190ca625a7762..b3dbcfdafab5093752e51d2e831b2c594175eacb 100644 --- a/Modules/Wrappers/SWIG/test/python/CMakeLists.txt +++ b/Modules/Wrappers/SWIG/test/python/CMakeLists.txt @@ -84,3 +84,8 @@ add_test( NAME pyTvNewStyleParameters ${OTB_DATA_ROOT}/Input/poupees.tif ${TEMP}/pyTvNewStyleParametersTest.tif ${OTB_DATA_ROOT}/Input/apTvUtSmoothingTest_OutXML.xml) + +add_test( NAME pyTvNewStyleParametersInstanciateAll + COMMAND ${TEST_DRIVER} Execute + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonNewStyleParametersInstanciateAllTest.py + ) diff --git a/Modules/Wrappers/SWIG/test/python/PythonNewStyleParametersInstanciateAllTest.py b/Modules/Wrappers/SWIG/test/python/PythonNewStyleParametersInstanciateAllTest.py new file mode 100644 index 0000000000000000000000000000000000000000..7151dc07d23cc782234e06b42771b89d2f21ecb1 --- /dev/null +++ b/Modules/Wrappers/SWIG/test/python/PythonNewStyleParametersInstanciateAllTest.py @@ -0,0 +1,14 @@ +import otbApplication as otb +import operator +import inspect +# List applications +appNames = [app for app in otb.Registry.GetAvailableApplications()] +for appName in appNames: + app = otb.Registry.CreateApplication(appName) + # Generate parameters + parameters = app.GetParametersKeys() + for param in parameters: + upParam = param.upper() + if app.HasValue(param): + operator.attrgetter(upParam)(app) +