From dcfa0af1dea096abe55d123f3553c5108ada80fb Mon Sep 17 00:00:00 2001
From: Antoine Regimbeau <antoine.regimbeau@c-s.fr>
Date: Thu, 7 Mar 2019 15:14:32 +0100
Subject: [PATCH] BUG: test using numpy should be run if there is numpy

---
 .../Wrappers/SWIG/test/python/CMakeLists.txt  | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/Modules/Wrappers/SWIG/test/python/CMakeLists.txt b/Modules/Wrappers/SWIG/test/python/CMakeLists.txt
index 0b667109c1..5e3d1c8c90 100644
--- a/Modules/Wrappers/SWIG/test/python/CMakeLists.txt
+++ b/Modules/Wrappers/SWIG/test/python/CMakeLists.txt
@@ -98,6 +98,8 @@ add_test( NAME pyTvBandMathInXML
 
 set_tests_properties(pyTvBandMathInXML PROPERTIES DEPENDS pyTvBandMathOutXML)
 
+if ( NUMPY_FOUND )
+
 add_test( NAME pyTvNumpyIO
   COMMAND ${TEST_DRIVER} Execute
   ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonTestDriver.py
@@ -105,6 +107,16 @@ add_test( NAME pyTvNumpyIO
   ${OTB_DATA_ROOT}/Input/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
   ${TEMP}/pyTvNumpyIO_SmoothingOut.png )
 
+
+add_test( NAME pyTvImageInterface
+  COMMAND ${TEST_DRIVER} Execute
+  ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonTestDriver.py
+  PythonImageInterface
+  ${OTB_DATA_ROOT}/Input/QB_Toulouse_Ortho_XS.tif
+  )
+
+endif()
+
 add_test( NAME pyTvNewStyleParameters
   COMMAND ${TEST_DRIVER} Execute
   ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonTestDriver.py
@@ -138,10 +150,3 @@ add_test( NAME pyTvParametersDict
   ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonTestDriver.py
   PythonParametersDict
   ${OTB_DATA_ROOT}/Input/poupees.tif)
-
-add_test( NAME pyTvImageInterface
-  COMMAND ${TEST_DRIVER} Execute
-  ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonTestDriver.py
-  PythonImageInterface
-  ${OTB_DATA_ROOT}/Input/QB_Toulouse_Ortho_XS.tif
-  )
-- 
GitLab