GeoMech data model and reader unit test framework.

This commit is contained in:
Jacob Støren
2015-04-23 13:24:15 +02:00
parent 1f2bea106f
commit 4737807b7b
14 changed files with 680 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
cmake_minimum_required (VERSION 2.8)
project ( OdbReader_UnitTests )
set(RI_ODB_API_DIR C:/pfRoot/jjsOnJacobpcCsdep/User/Sigurd/OdbApiExperiments/OdbApi/x64 CACHE PATH "Path tho the ODB api from Simulia")
set(RI_VIZ_FWK_ROOT ../../../Fwk/main/VizFwk CACHE PATH "Path to VizFwk")
set(RI_GTEST_ROOT ../../../ThirdParty CACHE PATH "Path to forlder containing gtest folder")
include(${RI_VIZ_FWK_ROOT}/CMake/Utils/ceeDetermineCompilerFlags.cmake)
add_subdirectory(${RI_VIZ_FWK_ROOT}/LibCore buildVizFwk)
add_subdirectory(../GeoMechDataModel buildGeoMechDataModel)
add_subdirectory(../OdbReader buildOdbReader)
include_directories(${RI_ODB_API_DIR}/include)
include_directories(${RI_VIZ_FWK_ROOT}/LibCore)
include_directories(../GeoMechDataModel)
include_directories(../OdbReader)
include_directories(${RI_GTEST_ROOT})
set( UNIT_TEST_CPP_SOURCES
main.cpp
RifOdbReader-Test.cpp
${RI_GTEST_ROOT}/gtest/gtest-all.cc
)
set( LINK_LIBRARIES
LibCore
RigGeoMechDataModel
RifOdbReader
)
list(APPEND RI_ODB_LIBS
${RI_ODB_API_DIR}/lib/ABQSMAOdbDdbOdb.lib
${RI_ODB_API_DIR}/lib/ABQSMAOdbApi.lib
${RI_ODB_API_DIR}/lib/ABQSMAOdbCore.lib
${RI_ODB_API_DIR}/lib/ABQSMAOdbCoreGeom.lib
${RI_ODB_API_DIR}/lib/ABQSMAOdbAttrEO.lib
${RI_ODB_API_DIR}/lib/ABQSMAAbuBasicUtils.lib
${RI_ODB_API_DIR}/lib/ABQSMABasShared.lib
${RI_ODB_API_DIR}/lib/ABQSMABasCoreUtils.lib
${RI_ODB_API_DIR}/lib/ABQSMAStiCAE_StableTime.lib
${RI_ODB_API_DIR}/lib/ABQSMABasMem.lib
${RI_ODB_API_DIR}/lib/ABQSMAAbuGeom.lib
${RI_ODB_API_DIR}/lib/ABQSMARomDiagEx.lib
${RI_ODB_API_DIR}/lib/ABQSMASspUmaCore.lib
${RI_ODB_API_DIR}/lib/ABQSMASimInterface.lib
${RI_ODB_API_DIR}/lib/ABQSMAMtxCoreModule.lib
)
set( EXTERNAL_LINK_LIBRARIES ${RI_ODB_LIBS})
add_executable( ${PROJECT_NAME} ${UNIT_TEST_CPP_SOURCES} )
target_link_libraries( ${PROJECT_NAME} ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES})
# Copy Dlls
if (MSVC)
file (GLOB ABA_DLLS_FULL ${RI_ODB_API_DIR}/lib/*.dll)
foreach (aDLL ${ABA_DLLS_FULL})
get_filename_component(filenameWithExt ${aDLL} NAME)
list(APPEND ABA_DLLS ${filenameWithExt} )
endforeach(aDLL)
foreach (aDLL ${ABA_DLLS})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${RI_ODB_API_DIR}/lib/${aDLL}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>")
endforeach()
endif(MSVC)

View File

@@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "gtest/gtest.h"
#include "RifOdbReader.h"
#include "RigGeoMechCaseData.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(OdbReaderTest, BasicTests)
{
cvf::ref<RifOdbReader> reader = new RifOdbReader;
cvf::ref<RigGeoMechCaseData> femData = new RigGeoMechCaseData;
reader->open("testfile.odb", femData.p());
}

View File

@@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015 - Statoil ASA
// Copyright (C) 2015 - Ceetron Solutions AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "cvfBase.h"
#include "gtest/gtest.h"
#include <stdio.h>
#include "cvfTrace.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int main(int argc, char **argv)
{
cvf::Assert::setReportMode(cvf::Assert::CONSOLE);
testing::InitGoogleTest(&argc, argv);
int result = RUN_ALL_TESTS();
std::cout << "Please press <Enter> to close the window.";
std::cin.get();
return result;
}