Commit 143eb4b6 authored by Otmane Lahlou's avatar Otmane Lahlou

ENH: avoid compiling tests relying on ApplicationsWrapper when OTB_WRAP_QT is not set

parent bb925623
......@@ -9,6 +9,7 @@ if(OTB_DATA_USE_LARGEINPUT)
endif(OTB_DATA_USE_LARGEINPUT)
set(Common_TESTS ${CXX_TEST_PATH}/mvdCommonTests)
set(Common_TESTS1 ${CXX_TEST_PATH}/mvdCommonTests1)
include_directories(
${Monteverdi2_BINARY_DIR}
......@@ -18,37 +19,52 @@ include_directories(
)
# add source files
set(Common_SRCS
mvdApplicationsToolBoxTest.cxx
mvdApplicationsBrowserTest.cxx
mvdFillToolBoxWidgetTreeTest.cxx
)
set(Common_SRCS mvdApplicationsToolBoxTest.cxx )
if (OTB_USE_QT)
set(Common_SRCS1
mvdApplicationsBrowserTest.cxx
mvdFillToolBoxWidgetTreeTest.cxx
)
endif()
#-------------- Monteverdi Common Tests ---------------------------------
# Applications toolBox test
add_test(apTvMonteverdi2ApplicationsToolBox ${Common_TESTS} mvdApplicationsToolBoxTest)
# Applications browser test
add_test(apTvMonteverdi2ApplicationsBrowser ${Common_TESTS}
mvdApplicationsBrowserTest
${OTB_DIR}/bin
)
# test when OTB_USE_QT is set to ON
if (OTB_USE_QT)
# Fill ToolBox algorithms tree
add_test(apTvMonteverdi2FillToolBoxTree ${Common_TESTS}
mvdFillToolBoxWidgetTreeTest
${OTB_DIR}/bin
)
# Applications browser test
add_test(apTvMonteverdi2ApplicationsBrowser ${Common_TESTS1}
mvdApplicationsBrowserTest
${OTB_DIR}/bin
)
# Fill ToolBox algorithms tree
add_test(apTvMonteverdi2FillToolBoxTree ${Common_TESTS1}
mvdFillToolBoxWidgetTreeTest
${OTB_DIR}/bin
)
endif()
#-------------- Link ---------------------------------
add_executable(mvdCommonTests mvdCommonTests.cxx ${Common_SRCS})
target_link_libraries(mvdCommonTests
Monteverdi2_Gui
Monteverdi2_Core
Monteverdi2_ApplicationsWrapper
OTBTesting)
if (OTB_USE_QT)
add_executable(mvdCommonTests1 mvdCommonTests1.cxx ${Common_SRCS1})
target_link_libraries(mvdCommonTests1
Monteverdi2_Core
Monteverdi2_Gui
Monteverdi2_ApplicationsWrapper
OTBTesting)
endif()
......@@ -27,6 +27,4 @@
void RegisterTests()
{
REGISTER_TEST(mvdApplicationsToolBoxTest);
REGISTER_TEST(mvdApplicationsBrowserTest);
REGISTER_TEST(mvdFillToolBoxWidgetTreeTest);
}
/*=========================================================================
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 otbCommonTest for the test driver
// and all it expects is that you have a function called RegisterTests
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include <iostream>
#include "otbTestMain.h"
void RegisterTests()
{
REGISTER_TEST(mvdApplicationsBrowserTest);
REGISTER_TEST(mvdFillToolBoxWidgetTreeTest);
}
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