]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
tests on Linux
authorasl <asl@opencascade.com>
Mon, 19 Oct 2015 06:00:50 +0000 (09:00 +0300)
committerasl <asl@opencascade.com>
Mon, 19 Oct 2015 06:00:50 +0000 (09:00 +0300)
src/HYDRO_tests/CMakeLists.txt
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/TestViewer.h
src/HYDRO_tests/test_HYDROData_Main.cxx

index 30e87f5bf2abc4db6a4f82edbbab14eb7f9ec02b..4e4a41149c152c4fd2f6ee1b92d3eaf3626442f0 100644 (file)
@@ -53,7 +53,7 @@ ENDIF()
 SET( BOOST_INCLUDES $ENV{BOOST_ROOT_DIR}/include/boost-1_52 )
 SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT_DIR}/include )
 SET( CAS_INCLUDES $ENV{CAS_ROOT_DIR}/inc )
-SET( QT_INCLUDES $ENV{QT4_ROOT_DIR}/include $ENV{QT4_ROOT_DIR}/include/QtCore $ENV{QT4_ROOT_DIR}/include/QtGui )
+SET( QT_INCLUDES $ENV{QT4_ROOT_DIR}/include $ENV{QT4_ROOT_DIR}/include/QtCore $ENV{QT4_ROOT_DIR}/include/QtGui $ENV{QT4_ROOT_DIR}/include/QtTest )
 SET( GUI_INCLUDES $ENV{GUI_ROOT_DIR}/include/salome )
 
 IF( ${WIN32} )
@@ -65,9 +65,9 @@ SET( CAS_LIBRARIES TKernel TKLCAF TKCAF TKCDF TKMath TKG2d TKG3d TKBRep TKGeomBa
 
 link_directories( $ENV{QT4_ROOT_DIR}/lib )
 IF( ${WIN32} )
-  SET( QT_LIBRARIES QtCored4 QtGuid4 )
+  SET( QT_LIBRARIES QtCored4 QtGuid4 QtTestd4 )
 ELSE()
-  SET( QT_LIBRARIES QtCore QtGui )
+  SET( QT_LIBRARIES QtCore QtGui QtTest )
 ENDIF()
 
 link_directories( $ENV{CPPUNIT_ROOT_DIR}/lib )
index 0d9a66680f6d0371c4d5ebf1b93d56b8176af5c6..e48228a133ef724fdf8542ea5c6fd5712d394370 100644 (file)
@@ -69,6 +69,7 @@ QColor randomColor()
 {
   int r = test_rand();
   int aHue = r%255;
+  //std::cout << "hue: " << aHue << std::endl;
   QColor aColor = QColor::fromHsl( aHue, 255, 128 );
   return aColor;
 }
@@ -91,7 +92,7 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll,
   }
 }
 
-void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, char* theKey )
+void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey )
 {
   context()->EraseAll();
   
@@ -152,6 +153,7 @@ bool TestViewer::AssertImages( QString& theMessage )
 
   QString aPath = QDir::tempPath() + "/" + myKey + ".png";
   anActualImage.save( aPath );
+  std::cout << anActualImage.width() << "x" << anActualImage.height() << std::endl;
   theMessage = "The viewer contents does not correspond to the reference image: " + myKey;
   
   QImage aDiff( anExpectedRefImage.width(), anExpectedRefImage.height(), QImage::Format_ARGB32 );
index 669b5621b5ad1e9dede3a4bd536cf15f437d4ddc..9768982a2c603f3d0453520f7530ea78dbea07ef 100644 (file)
@@ -16,7 +16,7 @@ public:
   static OCCViewer_ViewWindow* viewWindow();
 
   static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor );
-  static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, char* theKey );
+  static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey );
   static bool AssertImages( QString& theMessage );
 
 private:
index 40d7c4a3f0d763458f7441b301c744bb284da2df..2ad810e282c0930bfd94bb6eda0b30f4aabc3393 100644 (file)
@@ -28,6 +28,7 @@
 #include <SUIT_Session.h>
 #include <QApplication>
 #include <QColor>
+#include <QTest>
 #include <random.h>
 
 int main( int argc, char* argv[] )
@@ -40,6 +41,7 @@ int main( int argc, char* argv[] )
   OCCViewer_ViewWindow* aWindow = TestViewer::viewWindow();
   aWindow->setGeometry( 200, 200, 800, 600 );
   aWindow->show();
+  QTest::qWaitForWindowShown( aWindow );
 
   std::string testPath = (argc > 1) ? std::string(argv[1]) : "";