Skip to content

Commit b2507d1

Browse files
scpetersmergify[bot]
authored andcommitted
Use GTEST_SKIP in unsupported tests (#604)
Also includes the following changes: * distortion_camera test: reference github issue * [fix] dvl test: check pointer in TearDown The TearDown unconditionally dereferences the engine pointer, which segfaults if the engine failed to load. Check the pointer before dereferencing. Signed-off-by: Steve Peters <scpeters@intrinsic.ai> (cherry picked from commit fc58044) # Conflicts: # test/integration/boundingbox_camera.cc # test/integration/camera.cc # test/integration/depth_camera.cc # test/integration/distortion_camera.cc # test/integration/dvl.cc # test/integration/gpu_lidar_sensor.cc # test/integration/rgbd_camera.cc # test/integration/segmentation_camera.cc # test/integration/thermal_camera.cc # test/integration/triggered_boundingbox_camera.cc # test/integration/triggered_camera.cc # test/integration/wide_angle_camera.cc
1 parent 7cfaddf commit b2507d1

12 files changed

Lines changed: 1302 additions & 25 deletions

test/integration/boundingbox_camera.cc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,24 @@ void BoundingBoxCameraSensorTest::BoxesWithBuiltinSDF(
216216
// Skip unsupported engines
217217
if (_renderEngine != "ogre2")
218218
{
219+
<<<<<<< HEAD
219220
igndbg << "Engine '" << _renderEngine
221+
=======
222+
GTEST_SKIP() << "Engine '" << _renderEngine
223+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
220224
<< "' doesn't support bounding box cameras" << std::endl;
221-
return;
222225
}
223226

224227
// Setup ign-rendering with an empty scene
225228
auto *engine = rendering::engine(_renderEngine);
226229
if (!engine)
227230
{
231+
<<<<<<< HEAD
228232
igndbg << "Engine '" << _renderEngine
233+
=======
234+
GTEST_SKIP() << "Engine '" << _renderEngine
235+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
229236
<< "' is not supported" << std::endl;
230-
return;
231237
}
232238

233239
rendering::ScenePtr scene = engine->CreateScene("scene");
@@ -385,18 +391,24 @@ void BoundingBoxCameraSensorTest::Boxes3DWithBuiltinSDF(
385391
// Skip unsupported engines
386392
if (_renderEngine != "ogre2")
387393
{
394+
<<<<<<< HEAD
388395
igndbg << "Engine '" << _renderEngine
396+
=======
397+
GTEST_SKIP() << "Engine '" << _renderEngine
398+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
389399
<< "' doesn't support bounding box cameras" << std::endl;
390-
return;
391400
}
392401

393402
// Setup ign-rendering with an empty scene
394403
auto *engine = rendering::engine(_renderEngine);
395404
if (!engine)
396405
{
406+
<<<<<<< HEAD
397407
igndbg << "Engine '" << _renderEngine
408+
=======
409+
GTEST_SKIP() << "Engine '" << _renderEngine
410+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
398411
<< "' is not supported" << std::endl;
399-
return;
400412
}
401413

402414
rendering::ScenePtr scene = engine->CreateScene("scene");

test/integration/camera.cc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,12 @@ void CameraSensorTest::ImagesWithBuiltinSDF(const std::string &_renderEngine)
118118
auto *engine = ignition::rendering::engine(_renderEngine);
119119
if (!engine)
120120
{
121+
<<<<<<< HEAD
121122
igndbg << "Engine '" << _renderEngine
123+
=======
124+
GTEST_SKIP() << "Engine '" << _renderEngine
125+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
122126
<< "' is not supported" << std::endl;
123-
return;
124127
}
125128

126129
ignition::rendering::ScenePtr scene = engine->CreateScene("scene");
@@ -221,9 +224,12 @@ void CameraSensorTest::CameraIntrinsics(const std::string &_renderEngine)
221224
auto *engine = gz::rendering::engine(_renderEngine);
222225
if (!engine)
223226
{
227+
<<<<<<< HEAD
224228
igndbg << "Engine '" << _renderEngine
229+
=======
230+
GTEST_SKIP() << "Engine '" << _renderEngine
231+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
225232
<< "' is not supported" << std::endl;
226-
return;
227233
}
228234

229235
gz::rendering::ScenePtr scene = engine->CreateScene("scene");
@@ -519,9 +525,12 @@ void CameraSensorTest::CameraProjection(const std::string &_renderEngine)
519525
auto *engine = gz::rendering::engine(_renderEngine);
520526
if (!engine)
521527
{
528+
<<<<<<< HEAD
522529
igndbg << "Engine '" << _renderEngine
530+
=======
531+
GTEST_SKIP() << "Engine '" << _renderEngine
532+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
523533
<< "' is not supported" << std::endl;
524-
return;
525534
}
526535

527536
gz::rendering::ScenePtr scene = engine->CreateScene("scene");
@@ -810,9 +819,12 @@ void CameraSensorTest::ImageFormatLInt8(const std::string &_renderEngine)
810819
auto *engine = ignition::rendering::engine(_renderEngine);
811820
if (!engine)
812821
{
822+
<<<<<<< HEAD
813823
igndbg << "Engine '" << _renderEngine
824+
=======
825+
GTEST_SKIP() << "Engine '" << _renderEngine
826+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
814827
<< "' is not supported" << std::endl;
815-
return;
816828
}
817829

818830
ignition::rendering::ScenePtr scene = engine->CreateScene("scene");

test/integration/depth_camera.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,12 @@ void DepthCameraSensorTest::ImagesWithBuiltinSDF(
188188
if ((_renderEngine.compare("ogre") != 0) &&
189189
(_renderEngine.compare("ogre2") != 0))
190190
{
191+
<<<<<<< HEAD
191192
igndbg << "Engine '" << _renderEngine
193+
=======
194+
GTEST_SKIP() << "Engine '" << _renderEngine
195+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
192196
<< "' doesn't support depth cameras" << std::endl;
193-
return;
194197
}
195198

196199
// Setup ign-rendering with an empty scene

test/integration/distortion_camera.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,28 @@ void DistortionCameraSensorTest::ImagesWithBuiltinSDF(
8080

8181
if (_renderEngine == "ogre2")
8282
{
83+
<<<<<<< HEAD
8384
igndbg << "Distortion camera not supported yet in rendering engine: "
8485
<< _renderEngine << std::endl;
8586
return;
87+
=======
88+
GTEST_SKIP() << "Distortion camera not supported yet in rendering engine: "
89+
<< _renderEngine
90+
<< ", see https://github.com/gazebosim/gz-rendering/issues/697"
91+
<< std::endl;
92+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
8693
}
8794

8895
// Setup ign-rendering with an empty scene
8996
auto *engine = gz::rendering::engine(_renderEngine);
9097
if (!engine)
9198
{
99+
<<<<<<< HEAD
92100
igndbg << "Engine '" << _renderEngine
101+
=======
102+
GTEST_SKIP() << "Engine '" << _renderEngine
103+
>>>>>>> fc58044 (Use GTEST_SKIP in unsupported tests (#604))
93104
<< "' is not supported" << std::endl;
94-
return;
95105
}
96106

97107
gz::rendering::ScenePtr scene = engine->CreateScene("scene");

0 commit comments

Comments
 (0)