Skip to content
Permalink
Browse files

Finish Travis hacks

  • Loading branch information
wonder-sk committed Jul 25, 2018
1 parent 4b88bfb commit 0bfe5014bca26a44af8fe7fe3b3301123c9793f3
Showing with 12 additions and 4 deletions.
  1. +12 −4 tests/src/3d/testqgs3drendering.cpp
@@ -127,9 +127,13 @@ void TestQgs3DRendering::testFlatTerrain()

// look from the top
scene->cameraController()->setLookingAtPoint( QgsVector3D( 0, 0, 0 ), 2500, 0, 0 );

// When running the test on Travis, it would initially return empty rendered image.
// Capturing the initial image and throwing it away fixes that. Hopefully we will
// find a better fix in the future.
Qgs3DUtils::captureSceneImage( engine, scene );

QImage img = Qgs3DUtils::captureSceneImage( engine, scene );
//QTest::qSleep( 100 ); // a hack to avoid blank render on Travis
img = Qgs3DUtils::captureSceneImage( engine, scene );
QVERIFY( renderCheck( "flat_terrain_1", img, 40 ) );

// tilted view (pitch = 60 degrees)
@@ -162,9 +166,13 @@ void TestQgs3DRendering::testDemTerrain()
engine.setRootEntity( scene );

scene->cameraController()->setLookingAtPoint( QgsVector3D( 0, 0, 0 ), 2000, 60, 0 );

// When running the test on Travis, it would initially return empty rendered image.
// Capturing the initial image and throwing it away fixes that. Hopefully we will
// find a better fix in the future.
Qgs3DUtils::captureSceneImage( engine, scene );

QImage img3 = Qgs3DUtils::captureSceneImage( engine, scene );
QTest::qSleep( 100 ); // a hack to avoid blank render on Travis
img3 = Qgs3DUtils::captureSceneImage( engine, scene );

QVERIFY( renderCheck( "dem_terrain_1", img3, 40 ) );
}

0 comments on commit 0bfe501

Please sign in to comment.
You can’t perform that action at this time.