Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Finish Travis hacks
  • Loading branch information
wonder-sk committed Jul 26, 2018
1 parent 4b88bfb commit 0bfe501
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/src/3d/testqgs3drendering.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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 ) );
}
Expand Down

0 comments on commit 0bfe501

Please sign in to comment.