Salome HOME
Remove GTest tests for C++ High API
authorspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 14:53:44 +0000 (17:53 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 15:23:58 +0000 (18:23 +0300)
CMakeCommon/GTest.cmake [deleted file]
src/ConstructionAPI/CMakeLists.txt
src/ConstructionAPI/Test/CMakeLists.txt [deleted file]
src/ConstructionAPI/Test/TestPoint.cpp [deleted file]
src/ModelHighAPI/CMakeLists.txt
src/ModelHighAPI/Test/CMakeLists.txt [deleted file]
src/ModelHighAPI/Test/TestDouble.cpp [deleted file]
src/ModelHighAPI/Test/TestSelection.cpp [deleted file]

diff --git a/CMakeCommon/GTest.cmake b/CMakeCommon/GTest.cmake
deleted file mode 100644 (file)
index 13c2455..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-cmake_minimum_required (VERSION 2.6)
-
-include(FindGTest)
-
-
-#FIND_PACKAGE(GTest REQUIRED)
-#INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
-
-#FIND_PACKAGE(GMock REQUIRED)
-#INCLUDE_DIRECTORIES(${GMOCK_INCLUDE_DIRS})
-
-
-# GCC 4.4.6 does not support some C++11 features used by GMock 
-add_definitions(-DGTEST_LANG_CXX11=0)
-
-include_directories(
-  $ENV{GTEST_ROOT}/googletest/include
-  $ENV{GTEST_ROOT}/googlemock/include
-)
-    
-set(GTEST_LIBRARY $ENV{GTEST_ROOT}/googlemock/make/gmock_main.a)
-  
\ No newline at end of file
index 2dcb3b5a9a2fe78cf41528681d6aca43a5d2fd7b..67cad0d490a3d89bee97d5a0164992ba4a439b4e 100644 (file)
@@ -79,5 +79,3 @@ INCLUDE(UnitTest)
 ADD_UNIT_TESTS(
   TestPoint.py
 )
-
-# ADD_SUBDIRECTORY (Test)
diff --git a/src/ConstructionAPI/Test/CMakeLists.txt b/src/ConstructionAPI/Test/CMakeLists.txt
deleted file mode 100644 (file)
index b04b43d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-include(GTest)
-
-set(PROJECT_SOURCES
-  TestPoint.cpp
-)
-
-include_directories(
-  ${PROJECT_SOURCE_DIR}/src/ConstructionAPI
-  ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/Mock
-)
-
-set(PROJECT_LIBRARIES
-  ModelAPI
-  ModelHighAPI
-  ConstructionAPI
-)
-
-set(PACKAGE_NAME "ConstructionAPI")
-set(TARGET_NAME "Test${PACKAGE_NAME}")
-
-add_executable(${TARGET_NAME} ${PROJECT_SOURCES})
-target_link_libraries(${TARGET_NAME} ${PROJECT_LIBRARIES} ${GTEST_LIBRARY})
-
-GTEST_ADD_TESTS(${CMAKE_BINARY_DIR}/bin/${TARGET_NAME} "" ${PROJECT_SOURCES})
diff --git a/src/ConstructionAPI/Test/TestPoint.cpp b/src/ConstructionAPI/Test/TestPoint.cpp
deleted file mode 100644 (file)
index b053d5f..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-#include <Events_Loop.h>
-#include <Events_Error.h>
-
-#include <ModelAPI_Feature.h>
-#include <ModelHighAPI_Double.h>
-#include <ConstructionAPI_Point.h>
-
-#include <MockEvents_Listener.h>
-
-#include <MockModelAPI_AttributeDouble.h>
-#include <MockModelAPI_Data.h>
-#include <MockModelAPI_Document.h>
-#include <MockModelAPI_Feature.h>
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRefOfCopy;
-using ::testing::Test;
-
-// TODO(spo): should be common function
-void null_deleter(void *) {}
-
-class ConstructionAPI_Point_Constructor_Test : public Test {
-public:
-  MockEvents_Listener aErrorListener;
-  MockModelAPI_AttributeDouble aMockAttributeDouble;
-  MockModelAPI_Data aMockData;
-  MockModelAPI_Feature aMockFeature;
-  MockModelAPI_Document aMockDocument;
-
-  ConstructionAPI_Point_Constructor_Test() {
-    ON_CALL(aMockDocument, addFeature(_, _))
-      .WillByDefault(Return(std::shared_ptr<ModelAPI_Feature>(&aMockFeature, &null_deleter)));
-
-    ON_CALL(aMockFeature, getKind())
-      .WillByDefault(ReturnRefOfCopy(std::string("Point")));
-
-    ON_CALL(aMockFeature, data())
-      .WillByDefault(Return(std::shared_ptr<ModelAPI_Data>(&aMockData, &null_deleter)));
-
-    ON_CALL(aMockData, real(_))
-      .WillByDefault(Return(std::shared_ptr<ModelAPI_AttributeDouble>(&aMockAttributeDouble, &null_deleter)));
-
-    Events_Loop::loop()->registerListener(&aErrorListener, Events_Error::errorID());
-  }
-
-  ~ConstructionAPI_Point_Constructor_Test() {
-    Events_Loop::loop()->removeListener(&aErrorListener);
-  }
-
-  void testInitializeFeature() {
-    EXPECT_CALL(aMockFeature, getKind());
-
-    EXPECT_CALL(aMockFeature, data())
-      .Times(3);
-
-    EXPECT_CALL(aMockData, real("x"));
-    EXPECT_CALL(aMockData, real("y"));
-    EXPECT_CALL(aMockData, real("z"));
-  }
-
-  void testSetAttributes() {
-    EXPECT_CALL(aMockAttributeDouble, setValue(10));
-    EXPECT_CALL(aMockAttributeDouble, setText("20"));
-    EXPECT_CALL(aMockAttributeDouble, setText("x + 30"));
-
-    EXPECT_CALL(aMockFeature, execute());
-  }
-};
-
-TEST_F(ConstructionAPI_Point_Constructor_Test, GetEmptyFeature_SendException) {
-  FeaturePtr aFeature;
-
-  EXPECT_CALL(aErrorListener, processEvent(_));
-
-  ConstructionAPI_Point aPoint(aFeature);
-}
-
-TEST_F(ConstructionAPI_Point_Constructor_Test, GetEmptyFeatureAndValues_SendException) {
-  FeaturePtr aFeature;
-
-  EXPECT_CALL(aErrorListener, processEvent(_));
-
-  ConstructionAPI_Point aPoint(aFeature, 10, "20", std::string("x + 30"));
-}
-
-TEST_F(ConstructionAPI_Point_Constructor_Test, GetWrongFeature_SendException) {
-  FeaturePtr aFeature(&aMockFeature, &null_deleter);
-
-  ON_CALL(aMockFeature, getKind())
-    .WillByDefault(ReturnRefOfCopy(std::string("WrongKind")));
-
-  EXPECT_CALL(aMockFeature, getKind());
-  EXPECT_CALL(aErrorListener, processEvent(_));
-
-  ConstructionAPI_Point aPoint(aFeature);
-}
-
-
-TEST_F(ConstructionAPI_Point_Constructor_Test, GetFeature) {
-  FeaturePtr aFeature(&aMockFeature, &null_deleter);
-
-  testInitializeFeature();
-
-  ConstructionAPI_Point aPoint(aFeature);
-}
-
-TEST_F(ConstructionAPI_Point_Constructor_Test, GetFeatureAndValues) {
-  FeaturePtr aFeature(&aMockFeature, &null_deleter);
-
-  testInitializeFeature();
-  testSetAttributes();
-
-  ConstructionAPI_Point aPoint(aFeature, 10, "20", std::string("x + 30"));
-}
-
-
-TEST_F(ConstructionAPI_Point_Constructor_Test, addPoint) {
-  DocumentPtr aDocument(&aMockDocument, &null_deleter);
-
-  EXPECT_CALL(aMockDocument, addFeature("Point", true));
-
-  testInitializeFeature();
-  testSetAttributes();
-
-  PointPtr aPoint = addPoint(aDocument, 10, "20", std::string("x + 30"));
-}
index ec80ab7cff408f532fc7bd93b641c9702c92d710..7b450e5c58018974a6612b523d73e1fd913855ad 100644 (file)
@@ -80,5 +80,3 @@ ADD_UNIT_TESTS(
   TestInteger.py
   TestRefAttr.py
 )
-
-# ADD_SUBDIRECTORY (Test)
diff --git a/src/ModelHighAPI/Test/CMakeLists.txt b/src/ModelHighAPI/Test/CMakeLists.txt
deleted file mode 100644 (file)
index b99ca94..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-include(GTest)
-
-set(PROJECT_SOURCES
-  TestDouble.cpp
-  TestSelection.cpp
-)
-
-include_directories(
-  ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
-  ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/Mock
-)
-
-set(PROJECT_LIBRARIES
-  ModelHighAPI
-)
-
-set(PACKAGE_NAME "ModelHighAPI")
-set(TARGET_NAME "Test${PACKAGE_NAME}")
-
-add_executable(${TARGET_NAME} ${PROJECT_SOURCES})
-target_link_libraries(${TARGET_NAME} ${PROJECT_LIBRARIES} ${GTEST_LIBRARY})
-
-GTEST_ADD_TESTS(${CMAKE_BINARY_DIR}/bin/${TARGET_NAME} "" ${PROJECT_SOURCES})
diff --git a/src/ModelHighAPI/Test/TestDouble.cpp b/src/ModelHighAPI/Test/TestDouble.cpp
deleted file mode 100644 (file)
index dcba7f3..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-#include <ModelHighAPI_Double.h>
-
-#include <MockModelAPI_AttributeDouble.h>
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRefOfCopy;
-using ::testing::Test;
-
-// TODO(spo): should be common function
-static void null_deleter(void *) {}
-
-class HighModelAPI_Double_Test : public Test {
-public:
-  MockModelAPI_AttributeDouble aMockAttributeDouble;
-  std::shared_ptr<ModelAPI_AttributeDouble> anAttributeDouble;
-
-  HighModelAPI_Double_Test() {
-    anAttributeDouble = std::shared_ptr<ModelAPI_AttributeDouble>(&aMockAttributeDouble, &null_deleter);
-  }
-
-  ~HighModelAPI_Double_Test() {
-  }
-};
-
-TEST_F(HighModelAPI_Double_Test, Default) {
-  ModelHighAPI_Double aValue;
-
-  EXPECT_CALL(aMockAttributeDouble, setValue(0.));
-
-  aValue.fillAttribute(anAttributeDouble);
-}
-
-TEST_F(HighModelAPI_Double_Test, Double) {
-  ModelHighAPI_Double aValue(100.5);
-
-  EXPECT_CALL(aMockAttributeDouble, setValue(100.5));
-
-  aValue.fillAttribute(anAttributeDouble);
-}
-
-TEST_F(HighModelAPI_Double_Test, Char) {
-  ModelHighAPI_Double aValue("20");
-
-  EXPECT_CALL(aMockAttributeDouble, setText("20"));
-
-  aValue.fillAttribute(anAttributeDouble);
-}
-
-TEST_F(HighModelAPI_Double_Test, String) {
-  ModelHighAPI_Double aValue(std::string("x + 30"));
-
-  EXPECT_CALL(aMockAttributeDouble, setText("x + 30"));
-
-  aValue.fillAttribute(anAttributeDouble);
-}
diff --git a/src/ModelHighAPI/Test/TestSelection.cpp b/src/ModelHighAPI/Test/TestSelection.cpp
deleted file mode 100644 (file)
index 11ac67e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-#include <ModelHighAPI_Selection.h>
-
-#include <MockModelAPI_AttributeSelection.h>
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRefOfCopy;
-using ::testing::Test;
-
-// TODO(spo): should be common function
-static void null_deleter(void *) {}
-
-class HighModelAPI_Selection_Test : public Test {
-public:
-  MockModelAPI_AttributeSelection aMockAttributeSelection;
-  std::shared_ptr<ModelAPI_AttributeSelection> anAttributeSelection;
-
-  HighModelAPI_Selection_Test() {
-    anAttributeSelection = std::shared_ptr<ModelAPI_AttributeSelection>(&aMockAttributeSelection, &null_deleter);
-  }
-
-  ~HighModelAPI_Selection_Test() {
-  }
-};
-
-TEST_F(HighModelAPI_Selection_Test, Default) {
-  ModelHighAPI_Selection aValue;
-
-  EXPECT_CALL(aMockAttributeSelection, setValue(_, _, false));
-
-  aValue.fillAttribute(anAttributeSelection);
-}
-
-TEST_F(HighModelAPI_Selection_Test, ResultAndSubShape) {
-  std::shared_ptr<ModelAPI_Result> aResult;
-  std::shared_ptr<GeomAPI_Shape> aShape;
-  ModelHighAPI_Selection aValue(aResult, aShape);
-
-  EXPECT_CALL(aMockAttributeSelection, setValue(_, _, false));
-
-  aValue.fillAttribute(anAttributeSelection);
-}
-
-TEST_F(HighModelAPI_Selection_Test, TypeAndSubShapeName) {
-  ModelHighAPI_Selection aValue("Type", "SubShapeName");
-
-  EXPECT_CALL(aMockAttributeSelection, selectSubShape("Type", "SubShapeName"));
-
-  aValue.fillAttribute(anAttributeSelection);
-}