]> Creatis software - clitk.git/commitdiff
remove vvTests because of google framework...
authormpech <maxime.pech@insa-lyon.fr>
Tue, 26 Jul 2011 08:35:01 +0000 (10:35 +0200)
committermpech <maxime.pech@insa-lyon.fr>
Tue, 26 Jul 2011 08:35:01 +0000 (10:35 +0200)
tests/CMakeLists.txt
tests/vv/CMakeLists.txt [deleted file]
tests/vv/vvMainTest.cxx [deleted file]
tests/vv/vvRegisterFormTest.cxx [deleted file]

index cb05856f1a7709329ac3940516cb502661c7c2eb..30beaaaeb2d97781361eae18e0be9181ddfcd7c5 100644 (file)
@@ -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 (file)
index 3707d77..0000000
+++ /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 (file)
index 90d122a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "gtest/gtest.h"
-#include <iostream>
-#include <QApplication>
-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 (file)
index 6c623df..0000000
+++ /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 <QUrl>
-#include <QSettings>
-#include "gtest/gtest.h"
-#include "vvConfiguration.h"
-#include <stdio.h>
-#include <fstream>
-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());
-}