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} )
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 )
{
int r = test_rand();
int aHue = r%255;
+ //std::cout << "hue: " << aHue << std::endl;
QColor aColor = QColor::fromHsl( aHue, 255, 128 );
return aColor;
}
}
}
-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();
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 );
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:
#include <SUIT_Session.h>
#include <QApplication>
#include <QColor>
+#include <QTest>
#include <random.h>
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]) : "";