Skip to content
Snippets Groups Projects
Commit ed324f51 authored by Julien Malik's avatar Julien Malik
Browse files

ENH: add Python tests

parent d7217f2d
No related branches found
No related tags found
No related merge requests found
add_subdirectory(Core)
add_subdirectory(Python)
add_subdirectory(QtWidget)
\ No newline at end of file
# 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
#
# 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment