From 752a9b408122ea9952851c04e75e74d041768dab Mon Sep 17 00:00:00 2001 From: mpech Date: Tue, 26 Jul 2011 10:35:01 +0200 Subject: [PATCH] remove vvTests because of google framework... --- tests/CMakeLists.txt | 28 ++---------------- tests/vv/CMakeLists.txt | 20 ------------- tests/vv/vvMainTest.cxx | 11 ------- tests/vv/vvRegisterFormTest.cxx | 52 --------------------------------- 4 files changed, 3 insertions(+), 108 deletions(-) delete mode 100644 tests/vv/CMakeLists.txt delete mode 100644 tests/vv/vvMainTest.cxx delete mode 100644 tests/vv/vvRegisterFormTest.cxx diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index cb05856..30beaaa 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,39 +9,17 @@ ENDIF() ADD_DEFINITIONS(-DCLITK_TEST_DATA_PATH="${CLITK_TEST_DATA_PATH}") #========================================================= #========================================================= -# Google test macro -macro(ADD_GOOGLE_TESTS executable) - foreach ( source ${ARGN} ) - file(READ "${source}" contents) - string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) - foreach(hit ${found_tests}) - string(REGEX REPLACE ".*\\(([A-Za-z_0-9]+)[, ]*([A-Za-z_0-9]+)\\).*" "\\1.\\2" test_name ${hit}) - add_test(${test_name} ${executable} --gtest_filter=${test_name}) - endforeach(hit) - endforeach() -endmacro() -#========================================================= -#========================================================= SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/bin) SET(BUILDNAME ${CMAKE_SYSTEM_NAME}${CMAKE_OSX_ARCHITECTURES} CACHE INTERNAL DOCSTRING) #========================================================= #========================================================= -# GoogleTest framemwork -FIND_PATH(GTEST_DIR gtest) -INCLUDE_DIRECTORIES(${GTEST_DIR}/include/) - -FIND_LIBRARY(GTEST_LIB NAMES gtest PATHS ${GTEST_DIR}/build/) -ADD_LIBRARY(gtest UNKNOWN IMPORTED) -SET_PROPERTY(TARGET gtest PROPERTY IMPORTED_LOCATION "${GTEST_LIB}") -#========================================================= -#========================================================= # Enabled options to test IF(CLITK_BUILD_TOOLS) ADD_SUBDIRECTORY(tools) ENDIF() -IF(CLITK_BUILD_VV) - ADD_SUBDIRECTORY(vv) -ENDIF() +#IF(CLITK_BUILD_VV) +# ADD_SUBDIRECTORY(vv) +#ENDIF() # IF(CLITK_BUILD_SEGMENTATION) # ADD_SUBDIRECTORY(segmentation) # ENDIF() diff --git a/tests/vv/CMakeLists.txt b/tests/vv/CMakeLists.txt deleted file mode 100644 index 3707d77..0000000 --- a/tests/vv/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -include_directories( - ${PROJECT_SOURCE_DIR}/vv - ${PROJECT_BINARY_DIR}/vv - ${QT_QTGUI_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${QT_QTNETWORK_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR}/../ - ${PROJECT_SOURCE_DIR}/common - ${PROJECT_SOURCE_DIR}/tools - ${PROJECT_SOURCE_DIR}/segmentation - ${QT_LIBRARY_DIR} - ${GTEST_DIR}/include -) -FILE(GLOB srcs *.cxx) -ADD_EXECUTABLE(vvTest ${srcs}) -target_link_libraries(vvTest vvLib gtest) - -# Add all tests found in the source code, calling the executable to run them -add_google_tests ( ${EXECUTABLE_OUTPUT_PATH}/vvTest ${srcs}) -SET(BUILDNAME ${BUILDNAME}_vv CACHE INTERNAL DOCSTRING) diff --git a/tests/vv/vvMainTest.cxx b/tests/vv/vvMainTest.cxx deleted file mode 100644 index 90d122a..0000000 --- a/tests/vv/vvMainTest.cxx +++ /dev/null @@ -1,11 +0,0 @@ -#include "gtest/gtest.h" -#include -#include -int main(int argc, char** argv){ - QApplication* q=new QApplication ( argc, argv ); - ::testing::InitGoogleTest(&argc, argv); - - int a=RUN_ALL_TESTS(); - delete q; - return a; -} diff --git a/tests/vv/vvRegisterFormTest.cxx b/tests/vv/vvRegisterFormTest.cxx deleted file mode 100644 index 6c623df..0000000 --- a/tests/vv/vvRegisterFormTest.cxx +++ /dev/null @@ -1,52 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://www.centreleonberard.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -===========================================================================*/ -#include "vvRegisterForm.h" -#include -#include -#include "gtest/gtest.h" -#include "vvConfiguration.h" -#include -#include -const std::string data_path = CLITK_TEST_DATA_PATH; -TEST(vvRegisterForm, canPush){ - QUrl url; - //the file exists with some old lines - vvRegisterForm* v=new vvRegisterForm(url, QString::fromStdString(data_path+".settingsCanPush.txt"), QSettings::NativeFormat); - std::ifstream inFile((data_path+".settingsCanPush.txt").c_str(), std::ifstream::in); - ASSERT_FALSE(inFile.fail()); - EXPECT_TRUE(v->canPush()); - - //the file doesn't exist - vvRegisterForm* v2=new vvRegisterForm(url, QString::fromStdString(data_path+".settings_notFound.txt"), QSettings::NativeFormat); - EXPECT_TRUE(v2->canPush()); - - //the current version is the same - QString strSettings=QString::fromStdString(data_path+".settings2.txt"); - QSettings settings(strSettings, QSettings::NativeFormat); - settings.setValue("vvVersion", VV_VERSION); - vvRegisterForm* v3=new vvRegisterForm(url, strSettings, QSettings::NativeFormat); - EXPECT_FALSE(v3->canPush()); -} -TEST(vvRegisterForm, acquitPushed){ - QUrl url; - vvRegisterForm* v=new vvRegisterForm(url, QString::fromStdString(data_path+".settingsAcquit.txt"), QSettings::NativeFormat); - ASSERT_TRUE(v->canPush()); - v->acquitPushed(); - EXPECT_FALSE(v->canPush()); - remove((data_path+".settingsAcquit.txt").c_str()); -} -- 2.47.1