diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index 5e3f8f4c9fff681f0c96d383d8f809dad4ce5d9a..553715f16c5dc4001bea11d25ffebc65df8951ad 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(Core) +add_subdirectory(Python) add_subdirectory(QtWidget) \ No newline at end of file diff --git a/Testing/Python/CMakeLists.txt b/Testing/Python/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..543c04d7999add14dc350ca283eaeac5c770803d --- /dev/null +++ b/Testing/Python/CMakeLists.txt @@ -0,0 +1,15 @@ +# configure the test driver +FIND_PROGRAM(OTB_TEST_DRIVER otbTestDriver PATHS ${OTB_DIR}/bin ${OTB_DIR}/../../bin DOC "Path to the otbTestDriver executable from OTB") + + +SET(TEST_DRIVER "${OTB_TEST_DRIVER}" + --add-before-env PYTHONPATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG" + --add-before-env ITK_AUTOLOAD_PATH "${CMAKE_BINARY_DIR}/Example/Smoothing" +) +SET(TEMP ${OTBWrapper_BINARY_DIR}/Temporary) + +ADD_TEST( NAME PythonTest1 + COMMAND ${TEST_DRIVER} Execute + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonSmoothingTest.py + ${OTB_DATA_ROOT}/Input/ToulouseExtract_WithGeom.tif + ${TEMP}/ToulouseExtract_WithGeom_ ) \ No newline at end of file diff --git a/Testing/Python/PythonSmoothingTest.py b/Testing/Python/PythonSmoothingTest.py new file mode 100644 index 0000000000000000000000000000000000000000..521b7c6a126933b2199bffbe5685636a0467c6fe --- /dev/null +++ b/Testing/Python/PythonSmoothingTest.py @@ -0,0 +1,17 @@ +# +# Example on the use of the Smoothing +# +from sys import argv +import otbApplication + +print otbApplication.ApplicationRegistry.GetAvailableApplications() + +app = otbApplication.ApplicationRegistry.CreateApplication("Smoothing") +app.SetParameterString("in", argv[1]) + +for type in ['mean', 'gaussian', 'anidif']: + app.SetParameterString("type", type) + app.SetParameterString("out", argv[2] + type + ".tif") + app.Execute() + +print dir(app)