From d07d7ebf5fa5f6a479971cf7d7e56034c6e31db3 Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 20 Mar 2014 06:36:15 +0000 Subject: [PATCH] Move z levels sources. --- src/HYDROGUI/CMakeLists.txt | 22 ++++++++ .../HYDROGUI_ZLevelsDlg.cxx | 0 .../HYDROGUI_ZLevelsDlg.h | 0 .../HYDROGUI_ZLevelsModel.cxx | 0 .../HYDROGUI_ZLevelsModel.h | 0 src/HYDROGUI/test_HYDROGUI_Main.cxx | 50 ++++++++++++++++++ src/HYDROGUI/test_HYDROGUI_ZLevelsModel.cxx | 7 +++ src/HYDROGUI/test_HYDROGUI_ZLevelsModel.h | 17 ++++++ src/ZLEVEL/eye.png | Bin 362 -> 0 bytes src/ZLEVEL/gen.bat | 9 ---- src/ZLEVEL/main.cpp | 15 ------ src/ZLEVEL/zlevel.pro | 6 --- 12 files changed, 96 insertions(+), 30 deletions(-) rename src/{ZLEVEL => HYDROGUI}/HYDROGUI_ZLevelsDlg.cxx (100%) rename src/{ZLEVEL => HYDROGUI}/HYDROGUI_ZLevelsDlg.h (100%) rename src/{ZLEVEL => HYDROGUI}/HYDROGUI_ZLevelsModel.cxx (100%) rename src/{ZLEVEL => HYDROGUI}/HYDROGUI_ZLevelsModel.h (100%) create mode 100644 src/HYDROGUI/test_HYDROGUI_Main.cxx create mode 100644 src/HYDROGUI/test_HYDROGUI_ZLevelsModel.cxx create mode 100644 src/HYDROGUI/test_HYDROGUI_ZLevelsModel.h delete mode 100644 src/ZLEVEL/eye.png delete mode 100755 src/ZLEVEL/gen.bat delete mode 100644 src/ZLEVEL/main.cpp delete mode 100644 src/ZLEVEL/zlevel.pro diff --git a/src/HYDROGUI/CMakeLists.txt b/src/HYDROGUI/CMakeLists.txt index 612e9be9..1aa750d2 100644 --- a/src/HYDROGUI/CMakeLists.txt +++ b/src/HYDROGUI/CMakeLists.txt @@ -86,6 +86,8 @@ set(PROJECT_HEADERS HYDROGUI_BathymetryBoundsOp.h HYDROGUI_TranslateObstacleDlg.h HYDROGUI_TranslateObstacleOp.h + HYDROGUI_ZLevelsModel.h + HYDROGUI_ZLevelsDlg.h ) QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS}) @@ -173,6 +175,8 @@ set(PROJECT_SOURCES HYDROGUI_BathymetryBoundsOp.cxx HYDROGUI_TranslateObstacleDlg.cxx HYDROGUI_TranslateObstacleOp.cxx + HYDROGUI_ZLevelsModel.cxx + HYDROGUI_ZLevelsDlg.cxx ) add_definitions( @@ -227,3 +231,21 @@ FILE(GLOB GUIXML_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.xml") SET(GUI_DATA ${GUIPNG_DATA} ${GUIXML_DATA}) INSTALL(FILES ${GUI_DATA} DESTINATION ${SALOME_HYDRO_INSTALL_RES_DATA}) +# tests +if(SALOME_BUILD_TESTS) + + set(TEST_HEADERS + test_HYDROGUI_ZLevelsModel.h + ) + + set(TEST_SOURCES + test_HYDROGUI_Main.cxx + test_HYDROGUI_ZLevelsModel.cxx + ) + + set(TEST_EXE test_HYDROGUI) + include(../../CMake/CPPUnitTests.cmake) + target_link_libraries(test_HYDROGUI ${CAS_OCAF} ${CAS_MODELER} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} HYDROData HYDROGUI) + +endif(SALOME_BUILD_TESTS) + diff --git a/src/ZLEVEL/HYDROGUI_ZLevelsDlg.cxx b/src/HYDROGUI/HYDROGUI_ZLevelsDlg.cxx similarity index 100% rename from src/ZLEVEL/HYDROGUI_ZLevelsDlg.cxx rename to src/HYDROGUI/HYDROGUI_ZLevelsDlg.cxx diff --git a/src/ZLEVEL/HYDROGUI_ZLevelsDlg.h b/src/HYDROGUI/HYDROGUI_ZLevelsDlg.h similarity index 100% rename from src/ZLEVEL/HYDROGUI_ZLevelsDlg.h rename to src/HYDROGUI/HYDROGUI_ZLevelsDlg.h diff --git a/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx b/src/HYDROGUI/HYDROGUI_ZLevelsModel.cxx similarity index 100% rename from src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx rename to src/HYDROGUI/HYDROGUI_ZLevelsModel.cxx diff --git a/src/ZLEVEL/HYDROGUI_ZLevelsModel.h b/src/HYDROGUI/HYDROGUI_ZLevelsModel.h similarity index 100% rename from src/ZLEVEL/HYDROGUI_ZLevelsModel.h rename to src/HYDROGUI/HYDROGUI_ZLevelsModel.h diff --git a/src/HYDROGUI/test_HYDROGUI_Main.cxx b/src/HYDROGUI/test_HYDROGUI_Main.cxx new file mode 100644 index 00000000..67971549 --- /dev/null +++ b/src/HYDROGUI/test_HYDROGUI_Main.cxx @@ -0,0 +1,50 @@ +#include +#include +#include +#include +#include +#include +#include + +int + main( int argc, char* argv[] ) +{ + std::string testPath = (argc > 1) ? std::string(argv[1]) : ""; + + // Create the event manager and test controller + CppUnit::TestResult controller; + + // Add a listener that colllects test result + CppUnit::TestResultCollector result; + controller.addListener( &result ); + + // Add a listener that print dots as test run. + CppUnit::TextTestProgressListener progress; + controller.addListener( &progress ); + + CppUnit::TestFactoryRegistry& registry = + CppUnit::TestFactoryRegistry::getRegistry(); + // Add the top suite to the test runner + CppUnit::TestRunner runner; + runner.addTest( registry.makeTest() ); + try + { + std::cout << "Running " << testPath; + runner.run( controller, testPath ); + + std::cerr << std::endl; + + // Print test in a compiler compatible format. + CppUnit::CompilerOutputter outputter( &result, std::cerr ); + outputter.write(); + } + catch ( std::invalid_argument &e ) // Test path not resolved + { + std::cerr << std::endl + << "ERROR: " << e.what() + << std::endl; + return 0; + } + + return result.wasSuccessful() ? 0 : 1; +} diff --git a/src/HYDROGUI/test_HYDROGUI_ZLevelsModel.cxx b/src/HYDROGUI/test_HYDROGUI_ZLevelsModel.cxx new file mode 100644 index 00000000..3bbc4b5c --- /dev/null +++ b/src/HYDROGUI/test_HYDROGUI_ZLevelsModel.cxx @@ -0,0 +1,7 @@ +#include + + +void test_HYDROGUI_ZLevelsModel::testMoveUp() +{ + CPPUNIT_ASSERT(1 == 2); +} diff --git a/src/HYDROGUI/test_HYDROGUI_ZLevelsModel.h b/src/HYDROGUI/test_HYDROGUI_ZLevelsModel.h new file mode 100644 index 00000000..eb8d5efb --- /dev/null +++ b/src/HYDROGUI/test_HYDROGUI_ZLevelsModel.h @@ -0,0 +1,17 @@ +#include + +class test_HYDROGUI_ZLevelsModel : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(test_HYDROGUI_ZLevelsModel); + CPPUNIT_TEST(testMoveUp); + CPPUNIT_TEST_SUITE_END(); + +private: + +public: + + // checks move up + void testMoveUp(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(test_HYDROGUI_ZLevelsModel); +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(test_HYDROGUI_ZLevelsModel, "HYDROGUI_ZLevelsModel"); diff --git a/src/ZLEVEL/eye.png b/src/ZLEVEL/eye.png deleted file mode 100644 index f30a88777f1e69ffef1915c94829b4a89670a4b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 362 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!T+8vjv*HQb0>N7H5>4_9uB!t@IU*&QU?VV zp(KH%SH}Ba?OG{*<(vE)mD26$e^hULuZ`SmjAQ@+ diff --git a/src/ZLEVEL/gen.bat b/src/ZLEVEL/gen.bat deleted file mode 100755 index 9cd2c72b..00000000 --- a/src/ZLEVEL/gen.bat +++ /dev/null @@ -1,9 +0,0 @@ -call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" x86 -SET appendix="Visual Studio 9 2008" - -@SET PDIR=..\..\..\..\..\PRODUCTSD -call %PDIR%\env_compile.bat - -echo %PATH% - -qmake -tp vc -spec win32-msvc2008 zlevel.pro -r diff --git a/src/ZLEVEL/main.cpp b/src/ZLEVEL/main.cpp deleted file mode 100644 index 48b9828d..00000000 --- a/src/ZLEVEL/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "HYDROGUI_ZLevelsDlg.h" - -#include - -int main( int argc, char** argv ){ - QApplication app(argc, argv); - - HYDROGUI_ZLevelsDlg* aDlg = new HYDROGUI_ZLevelsDlg( 0 ); - QList< QString > anObjects; - anObjects << "A" << "B" << "C" << "D" << "E" << "F" << "G" << "H"; - aDlg->setObjects( anObjects ); - aDlg->show(); - - return app.exec(); -} \ No newline at end of file diff --git a/src/ZLEVEL/zlevel.pro b/src/ZLEVEL/zlevel.pro deleted file mode 100644 index 3193122f..00000000 --- a/src/ZLEVEL/zlevel.pro +++ /dev/null @@ -1,6 +0,0 @@ -HEADERS = HYDROGUI_ZLevelsDlg.h HYDROGUI_ZLevelsModel.h - -SOURCES = main.cpp HYDROGUI_ZLevelsDlg.cxx HYDROGUI_ZLevelsModel.cxx -CONFIG += qt - -TEMPLATE = app -- 2.39.2