Commit 4559b78e authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

TEST: fix some tests depending on ossim when running the tests with an installed version of OTB

parent 0e81d3a7
......@@ -16,6 +16,9 @@ IF(OTB_BINARY_DIR)
ELSE(OTB_BINARY_DIR)
# We are building as a stand-alone project.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(OTB_TESTING_STANDALONE ON)
SET(LIBRARY_OUTPUT_PATH ${OTBTesting_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
SET(EXECUTABLE_OUTPUT_PATH ${OTBTesting_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
......
......@@ -1626,55 +1626,6 @@ ADD_TEST(ioTvDEMToImageGeneratorFromImageTest2 ${IO_TESTS12}
10 15 16 64
)
ADD_TEST(ioTvossimElevManagerTest ${IO_TESTS12}
--compare-image ${EPSILON_9} ${BASELINE}/ioTvossimElevManagerTest.tif
${TEMP}/ioTvossimElevManagerTest.tif
otbOssimElevManagerTest
${INPUTDATA}/DEM/srtm_directory
${TEMP}/ioTvossimElevManagerTest.tif
6.5
45.5
0.002
-0.002
500
500
)
ADD_TEST(ioTvossimElevManagerTest3 ${IO_TESTS12}
--compare-image ${EPSILON_9} ${BASELINE}/ioTvossimElevManagerTest3.tif
${TEMP}/ioTvossimElevManagerTest3.tif
otbOssimElevManagerTest
${INPUTDATA}/DEM/srtm_directory
${TEMP}/ioTvossimElevManagerTest3.tif
-1.8 52 0.02 -0.018 232 422
# -1.8870830 52.0135758 0.024363378967 -0.018457085039 232 422
)
#This test investigate the problem with the ossimElevManager
# - differences between plaforms
# - file descriptor leak
ADD_TEST(ioTvossimElevManagerTest4 ${IO_TESTS12}
--compare-image ${EPSILON_9} ${BASELINE}/ioTvossimElevManagerTest3.tif
${TEMP}/ioTvossimElevManagerTest4.hdr
otbOssimElevManagerTest4
${INPUTDATA}/DEM/srtm_directory
${TEMP}/ioTvossimElevManagerTest4
-1.8 52 0.02 -0.018 232 422
)
ADD_TEST(ioTvossimElevManagerTest2 ${IO_TESTS12}
--compare-ascii ${EPSILON_9} ${BASELINE_FILES}/ioTvossimElevManagerTest2.txt
${TEMP}/ioTvossimElevManagerTest2.txt
otbOssimElevManagerTest2
${INPUTDATA}/DEM/srtm_directory
${TEMP}/ioTvossimElevManagerTest2.txt
6.5
44.5
0.002
500
)
# otb::MapProjectionAdapter (TODO: remove from IO)
ADD_TEST(ioTvMapProjectionAdapterTest ${IO_TESTS12}
--compare-ascii ${EPSILON_9}
......@@ -1685,29 +1636,6 @@ ADD_TEST(ioTvMapProjectionAdapterTest ${IO_TESTS12}
)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#----------------------------------------------------------------------------------
# Exemples de tests sur les grosses images
# Tests non lanc�s pour raison taille des fichiers produits
# ADD_TEST(ioTvStreamingIFWriterPARIS_SPOT5THR_WithoutStreaming ${IO_TESTS12}
# otbStreamingImageFileWriterTest
# ${LARGEDATA}/PARIS/SPOT5/THR
# ${TEMP}/ioStreamingImageFileWriterTestCAI_ParisSpot5THR_WithoutStreaming.hd
# 0 # Test sans streaming
# )
# ADD_TEST(ioTvStreamingIFWriterPARIS_SPOT5THR_WithStreaming_1000 ${IO_TESTS12}
# otbStreamingImageFileWriterTest
# ${LARGEDATA}/PARIS/SPOT5/THR
# ${TEMP}/ioStreamingImageFileWriterTestCAI_ParisSpot5THR_WithStreaming_1000.hd
# 1 # Test sans streaming
# 1000 # NbDivisionsStreaming
# )
#----------------------------------------------------------------------------------
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbIOTESTS13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -3305,14 +3233,12 @@ otbShortRGBImageIOTest.cxx
otbPNGIndexedNbBandsTest.cxx
)
#SET(BasicIO_SRCS4
#)
#CONTAINS THE BasicIO_SRCS2 include
SET(BasicIO_SRCS5
otbIOTests5.cxx
otbGDALImageIOTestCanRead.cxx
otbThreadsTest.cxx
)
SET(BasicIO_SRCS6
otbIOTests6.cxx
otbGDALImageIOTestCanWrite.cxx
......@@ -3325,6 +3251,7 @@ otbMSTARImageIOTestCanRead.cxx
otbImageFileReaderMSTAR.cxx
otbGDALImageIOTestWriteMetadata.cxx
)
SET(BasicIO_SRCS7
otbIOTests7.cxx
otbImageFileReaderTest.cxx
......@@ -3332,10 +3259,12 @@ otbImageFileReaderRGBTest.cxx
otbImageFileWriterTest.cxx
otbImageFileWriterRGBTest.cxx
)
SET(BasicIO_SRCS8
otbIOTests8.cxx
otbCoordinateToNameTest.cxx
)
SET(BasicIO_SRCS9
otbIOTests9.cxx
otbImageTest.cxx
......@@ -3345,12 +3274,14 @@ otbVectorImageFileReaderWriterTest.cxx
otbStreamingShortImageFileWriterTest.cxx
otbComplexImageTests.cxx
)
SET(BasicIO_SRCS10
otbIOTests10.cxx
otbStreamingImageFileWriterTestCalculateNumberOfDivisions.cxx
otbStreamingImageFileWriterWithFilterTest.cxx
otbStreamingWithImageFileWriterTestCalculateNumberOfDivisions.cxx
)
SET(BasicIO_SRCS11
otbIOTests11.cxx
otbImageMetadataFileWriterTest.cxx
......@@ -3358,6 +3289,7 @@ otbImageMetadataStreamingFileWriterTest.cxx
otbPipelineMetadataHandlingTest.cxx
otbPipelineMetadataHandlingWithUFFilterTest.cxx
)
SET(BasicIO_SRCS12
otbIOTests12.cxx
otbDEMHandlerNew.cxx
......@@ -3365,14 +3297,12 @@ otbDEMHandlerTest.cxx
otbDEMToImageGeneratorNew.cxx
otbDEMToImageGeneratorTest.cxx
otbDEMToImageGeneratorFromImageTest.cxx
otbOssimElevManagerTest.cxx
otbOssimElevManagerTest2.cxx
otbOssimElevManagerTest4.cxx
otbMapProjectionAdapterTest.cxx
)
IF(OTB_COMPILE_JPEG2000)
#Reserved for jpeg 2000
SET(BasicIO_SRCS13
otbIOTests13.cxx
otbJPEG2000ImageIOTestCanRead.cxx
......@@ -3450,6 +3380,7 @@ otbOssimJpegFileRessourceLeakTest.cxx
)
IF(OTB_USE_CURL)
#Reserved for CURL
SET(BasicIO_SRCS19
otbIOTests19.cxx
otbImageFileReaderServerName.cxx
......
......@@ -29,8 +29,5 @@ void RegisterTests()
REGISTER_TEST(otbDEMToImageGeneratorNew);
REGISTER_TEST(otbDEMToImageGeneratorTest);
REGISTER_TEST(otbDEMToImageGeneratorFromImageTest);
REGISTER_TEST(otbOssimElevManagerTest);
REGISTER_TEST(otbOssimElevManagerTest2);
REGISTER_TEST(otbOssimElevManagerTest4);
REGISTER_TEST(otbMapProjectionAdapterTest);
}
......@@ -14,11 +14,13 @@ SET(TEMP ${OTBTesting_BINARY_DIR}/Temporary)
SET(NOTOL 0.0)
SET(EPSILON_4 0.0001)
SET(EPSILON_6 0.000001)
SET(EPSILON_9 0.000000001)
SET(PROJECTIONS_TESTS1 ${CXX_TEST_PATH}/otbProjectionsTests1)
SET(PROJECTIONS_TESTS2 ${CXX_TEST_PATH}/otbProjectionsTests2)
SET(PROJECTIONS_TESTS3 ${CXX_TEST_PATH}/otbProjectionsTests3)
SET(PROJECTIONS_TESTS4 ${CXX_TEST_PATH}/otbProjectionsTests4)
SET(PROJECTIONS_TESTS5 ${CXX_TEST_PATH}/otbProjectionsTests5)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbPROJECTIONS_TESTS1 ~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -53,25 +55,6 @@ ADD_TEST(prTvMapProjectionsTest ${PROJECTIONS_TESTS1}
ADD_TEST(prTuSensorModelsNew ${PROJECTIONS_TESTS1} otbSensorModelsNew )
IF(OTB_DATA_USE_LARGEINPUT)
ADD_TEST(prTvTestCreateProjectionWithOSSIM_Toulouse ${PROJECTIONS_TESTS1}
otbCreateProjectionWithOSSIM
${LARGEINPUT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF
)
ADD_TEST(prTvTestCreateProjectionWithOSSIM_Cevennes ${PROJECTIONS_TESTS1}
otbCreateProjectionWithOSSIM
${LARGEINPUT}/QUICKBIRD/CEVENNES/06FEB12104912-P1BS-005533998070_01_P001.TIF
)
ADD_TEST(prTvTestCreateProjectionWithOTB_Toulouse ${PROJECTIONS_TESTS1}
otbCreateProjectionWithOTB
${LARGEINPUT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF
)
ADD_TEST(prTvTestCreateProjectionWithOTB_Cevennes ${PROJECTIONS_TESTS1}
otbCreateProjectionWithOTB
${LARGEINPUT}/QUICKBIRD/CEVENNES/06FEB12104912-P1BS-005533998070_01_P001.TIF
)
ADD_TEST(prTvTestCreateInverseForwardSensorModel_Toulouse ${PROJECTIONS_TESTS1}
otbCreateInverseForwardSensorModel
......@@ -1419,6 +1402,88 @@ ADD_TEST(prTvGenericRSTransformGenericTestEPSG4326toEPSG4326 ${PROJECTIONS_TESTS
ADD_TEST(prTvGenericRSTransformGenericTestEPSG4326toEPSG32631 ${PROJECTIONS_TESTS4}
otbGenericRSTransformGenericTest
1.3561728980 43.4876035537 367077.72312001337 4816277.086791252 EPSG 4326 EPSG 32631 GEO 1e-3 PHYSICAL 1e-3 NOELEV)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbPROJECTIONS_TESTS5 ~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF(NOT OTB_TESTING_STANDALONE)
ADD_TEST(prTvossimElevManagerTest ${PROJECTIONS_TESTS5}
--compare-image ${EPSILON_9} ${BASELINE}/prTvossimElevManagerTest.tif
${TEMP}/prTvossimElevManagerTest.tif
otbOssimElevManagerTest
${INPUTDATA}/DEM/srtm_directory
${TEMP}/prTvossimElevManagerTest.tif
6.5
45.5
0.002
-0.002
500
500
)
ADD_TEST(prTvossimElevManagerTest3 ${PROJECTIONS_TESTS5}
--compare-image ${EPSILON_9} ${BASELINE}/prTvossimElevManagerTest3.tif
${TEMP}/prTvossimElevManagerTest3.tif
otbOssimElevManagerTest
${INPUTDATA}/DEM/srtm_directory
${TEMP}/prTvossimElevManagerTest3.tif
-1.8 52 0.02 -0.018 232 422
# -1.8870830 52.0135758 0.024363378967 -0.018457085039 232 422
)
#This test investigate the problem with the ossimElevManager
# - differences between plaforms
# - file descriptor leak
ADD_TEST(prTvossimElevManagerTest4 ${PROJECTIONS_TESTS5}
--compare-image ${EPSILON_9} ${BASELINE}/prTvossimElevManagerTest3.tif
${TEMP}/prTvossimElevManagerTest4.hdr
otbOssimElevManagerTest4
${INPUTDATA}/DEM/srtm_directory
${TEMP}/prTvossimElevManagerTest4
-1.8 52 0.02 -0.018 232 422
)
ADD_TEST(prTvossimElevManagerTest2 ${PROJECTIONS_TESTS5}
--compare-ascii ${EPSILON_9} ${BASELINE_FILES}/prTvossimElevManagerTest2.txt
${TEMP}/prTvossimElevManagerTest2.txt
otbOssimElevManagerTest2
${INPUTDATA}/DEM/srtm_directory
${TEMP}/prTvossimElevManagerTest2.txt
6.5
44.5
0.002
500
)
IF(OTB_DATA_USE_LARGEINPUT)
ADD_TEST(prTvTestCreateProjectionWithOSSIM_Toulouse ${PROJECTIONS_TESTS1}
otbCreateProjectionWithOSSIM
${LARGEINPUT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF
)
ADD_TEST(prTvTestCreateProjectionWithOSSIM_Cevennes ${PROJECTIONS_TESTS1}
otbCreateProjectionWithOSSIM
${LARGEINPUT}/QUICKBIRD/CEVENNES/06FEB12104912-P1BS-005533998070_01_P001.TIF
)
ADD_TEST(prTvTestCreateProjectionWithOTB_Toulouse ${PROJECTIONS_TESTS1}
otbCreateProjectionWithOTB
${LARGEINPUT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF
)
ADD_TEST(prTvTestCreateProjectionWithOTB_Cevennes ${PROJECTIONS_TESTS1}
otbCreateProjectionWithOTB
${LARGEINPUT}/QUICKBIRD/CEVENNES/06FEB12104912-P1BS-005533998070_01_P001.TIF
)
ENDIF(OTB_DATA_USE_LARGEINPUT)
ENDIF(NOT OTB_TESTING_STANDALONE)
#=======================================================================================
SET(Projections_SRCS1
otbProjectionsTests1.cxx
......@@ -1427,8 +1492,6 @@ otbMapProjectionsNew.cxx
otbMapProjection.cxx
otbUtmMapProjection.cxx
otbSensorModelsNew.cxx
otbCreateProjectionWithOSSIM.cxx
otbCreateProjectionWithOTB.cxx
otbCreateInverseForwardSensorModel.cxx
otbRegionProjectionResampler.cxx
otbSensorModel.cxx
......@@ -1487,9 +1550,25 @@ otbVectorDataTransformFilter.cxx
otbGenericRSTransformGenericTest.cxx
)
#Tests requiring access to ossim header
#should not be launched when using an installed version of OTB
IF(NOT OTB_TESTING_STANDALONE)
SET(Projections_SRCS5
otbProjectionsTests5.cxx
otbOssimElevManagerTest.cxx
otbOssimElevManagerTest2.cxx
otbOssimElevManagerTest4.cxx
otbCreateProjectionWithOSSIM.cxx
otbCreateProjectionWithOTB.cxx
)
ENDIF(NOT OTB_TESTING_STANDALONE)
OTB_ADD_EXECUTABLE(otbProjectionsTests1 "${Projections_SRCS1}" "OTBProjections;OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbProjectionsTests2 "${Projections_SRCS2}" "OTBProjections;OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbProjectionsTests3 "${Projections_SRCS3}" "OTBProjections;OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbProjectionsTests4 "${Projections_SRCS4}" "OTBProjections;OTBIO;OTBTesting")
IF(NOT OTB_TESTING_STANDALONE)
OTB_ADD_EXECUTABLE(otbProjectionsTests5 "${Projections_SRCS5}" "OTBProjections;OTBIO;OTBTesting")
ENDIF(NOT OTB_TESTING_STANDALONE)
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
......
......@@ -30,8 +30,6 @@ void RegisterTests()
REGISTER_TEST(otbMapProjection);
REGISTER_TEST(otbUtmMapProjection);
REGISTER_TEST(otbSensorModelsNew);
REGISTER_TEST(otbCreateProjectionWithOSSIM);
REGISTER_TEST(otbCreateProjectionWithOTB);
REGISTER_TEST(otbCreateInverseForwardSensorModel);
REGISTER_TEST(otbRegionProjectionResampler);
REGISTER_TEST(otbSensorModel);
......
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
// this file defines the otbProjectionsTest for the test driver
// and all it expects is that you have a function called RegisterTests
#include "otbTestMain.h"
void RegisterTests()
{
REGISTER_TEST(otbOssimElevManagerTest);
REGISTER_TEST(otbOssimElevManagerTest2);
REGISTER_TEST(otbOssimElevManagerTest4);
REGISTER_TEST(otbCreateProjectionWithOSSIM);
REGISTER_TEST(otbCreateProjectionWithOTB);
}
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