From: Paul RASCLE Date: Mon, 9 May 2016 06:49:18 +0000 (+0200) Subject: HYDRO_tests working on install, building with yamm X-Git-Tag: v1.6~113^2~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c27fe366fcb92ebbaf459b0998011ec26a512212;p=modules%2Fhydro.git HYDRO_tests working on install, building with yamm --- diff --git a/src/HYDRO_tests/CMakeLists.txt b/src/HYDRO_tests/CMakeLists.txt index 35932e15..b77ef953 100644 --- a/src/HYDRO_tests/CMakeLists.txt +++ b/src/HYDRO_tests/CMakeLists.txt @@ -59,7 +59,7 @@ IF( ${WIN32} ) add_definitions( -DWNT ) ENDIF() -SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT}/include ) +SET( CPPUNIT_INCLUDES $ENV{cppUNIT_ROOT}/include ) SET( CAS_INCLUDES $ENV{CASROOT}/inc ) SET( QT_INCLUDES $ENV{QTDIR}/include $ENV{QTDIR}/include/QtCore $ENV{QTDIR}/include/QtGui $ENV{QTDIR}/include/QtTest ) SET( KERNEL_INCLUDES $ENV{KERNEL_ROOT_DIR}/include/salome ) @@ -80,7 +80,7 @@ ELSE() SET( QT_LIBRARIES QtCore QtGui QtTest ) ENDIF() -link_directories( $ENV{CPPUNIT_ROOT}/lib ) +link_directories( $ENV{cppUNIT_ROOT}/lib ) IF( ${WIN32} ) SET( CPPUNIT_LIBRARIES cppunitd ) ELSE() @@ -111,3 +111,5 @@ target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_ IF( ${WIN32} ) add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" ) ENDIF() + +INSTALL(TARGETS HYDROData_tests EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) diff --git a/src/HYDRO_tests/reference_data/CLC06-cut_1.dbf b/src/HYDRO_tests/reference_data/CLC06-cut_1.dbf new file mode 100644 index 00000000..5b19ee25 Binary files /dev/null and b/src/HYDRO_tests/reference_data/CLC06-cut_1.dbf differ diff --git a/src/HYDRO_tests/reference_data/CLC06-cut_1.shp b/src/HYDRO_tests/reference_data/CLC06-cut_1.shp new file mode 100644 index 00000000..bf683c34 Binary files /dev/null and b/src/HYDRO_tests/reference_data/CLC06-cut_1.shp differ diff --git a/src/HYDRO_tests/reference_data/CLC06-cut_1.shx b/src/HYDRO_tests/reference_data/CLC06-cut_1.shx new file mode 100644 index 00000000..e96b5f16 Binary files /dev/null and b/src/HYDRO_tests/reference_data/CLC06-cut_1.shx differ diff --git a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index 154e95ea..5adf002a 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -44,8 +44,12 @@ #include #include -const QString REF_DATA_PATH = qgetenv( "HYDRO_REFERENCE_DATA" ); -const QString DEF_STR_PATH = qgetenv( "HYDRO_SRC_DIR" ) + "/src/HYDROGUI/resources/def_strickler_table.txt"; +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + +//const QString REF_DATA_PATH = qgetenv( "HYDRO_REFERENCE_DATA" ); +const QString REF_DATA_PATH = qgetenv( "HYDRO_DIR" ) + "/../../src/HYDRO/src/HYDRO_tests/reference_data"; +const QString DEF_STR_PATH = qgetenv( "HYDRO_DIR" ) + "/../../src/HYDRO/src/HYDROGUI/resources/def_strickler_table.txt"; void test_HYDROData_LandCoverMap::test_add_2_objects() { @@ -882,13 +886,17 @@ void test_HYDROData_LandCoverMap::test_shp_loop_back() { QString aFFileName = REF_DATA_PATH + "/CLC06-cut_1.shp"; QString aSFileName = REF_DATA_PATH + "/CLC06-cut_1_res.shp"; + //This test verify only some geom data (shp+shx) without any dbf reading/writing { + DEBTRACE("aFFileName: " << aFFileName.toStdString()); + DEBTRACE("aSFileName: " << aSFileName.toStdString()); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); HYDROData_ShapeFile anImporter; QStringList PolygonList; TopTools_SequenceOfShape PolygonFaces; int Type = -1; + DEBTRACE("---"); //import LCM from file (#2-4; #12-14 polygons) CPPUNIT_ASSERT( anImporter.ImportPolygons(aDoc, aFFileName, PolygonList, PolygonFaces, Type)); @@ -901,6 +909,7 @@ void test_HYDROData_LandCoverMap::test_shp_loop_back() aMapFace2ST.Add( TopoDS::Face( PolygonFaces(12) ), "" ); aMapFace2ST.Add( TopoDS::Face( PolygonFaces(13) ), "" ); aMapFace2ST.Add( TopoDS::Face( PolygonFaces(14) ), "" ); + DEBTRACE("---"); LCM->StoreLandCovers(aMapFace2ST); LCM->SetName("lcm_1"); @@ -914,6 +923,7 @@ void test_HYDROData_LandCoverMap::test_shp_loop_back() QStringList aNonExpList; anExporter.Export(aSFileName, LCM, aNonExpList); CPPUNIT_ASSERT (aNonExpList.empty()); + DEBTRACE("---"); aDoc->Close(); } diff --git a/src/HYDRO_tests/test_HYDROData_Main.cxx b/src/HYDRO_tests/test_HYDROData_Main.cxx index 74bb9315..c4e3239e 100644 --- a/src/HYDRO_tests/test_HYDROData_Main.cxx +++ b/src/HYDRO_tests/test_HYDROData_Main.cxx @@ -34,6 +34,7 @@ int main( int argc, char* argv[] ) { QApplication anApp( argc, argv ); SUIT_Session aSession; + aSession.startApplication("std"); OCCViewer_ViewWindow* aWindow = TestViewer::viewWindow();