Skip to content

Commit

Permalink
Update GoogleTest to latest version (#658)
Browse files Browse the repository at this point in the history
* Remove old gtest version
* Add new vendored Googletest version
* Move test_config H to HH
* CMake updates for new googletest version
* Test updates for new googletest version
* Remove unnecessary gtest_main functions

Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll authored Jun 28, 2022
1 parent a781e09 commit 67ee5db
Show file tree
Hide file tree
Showing 112 changed files with 11,523 additions and 21,239 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR})
#============================================================================
# Set up the project
#============================================================================
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/rendering
VERSION_SUFFIX pre1)

#============================================================================
# Set project-specific options
#============================================================================

set(CMAKE_CXX_STANDARD 14)
option(USE_UNOFFICIAL_OGRE_VERSIONS "Accept unsupported Ogre versions in the build" OFF)

#============================================================================
Expand Down
6 changes: 0 additions & 6 deletions examples/simple_demo_qml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(gz-rendering-simple-demo-qml)

#------------------------------------------------------------------------
# Compile as C++14

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

#------------------------------------------------------------------------
# Find gz-cmake
find_package(gz-cmake3 REQUIRED)
Expand Down
10 changes: 2 additions & 8 deletions src/ArrowVisual_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)

#include "gz/rendering/ArrowVisual.hh"
#include "gz/rendering/RenderEngine.hh"
Expand Down Expand Up @@ -101,12 +101,6 @@ TEST_P(ArrowVisualTest, ArrowVisual)
ArrowVisual(GetParam());
}

INSTANTIATE_TEST_CASE_P(ArrowVisual, ArrowVisualTest,
INSTANTIATE_TEST_SUITE_P(ArrowVisual, ArrowVisualTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/AxisVisual_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)

#include "gz/rendering/ArrowVisual.hh"
#include "gz/rendering/AxisVisual.hh"
Expand Down Expand Up @@ -98,12 +98,6 @@ TEST_P(AxisVisualTest, AxisVisual)
AxisVisual(GetParam());
}

INSTANTIATE_TEST_CASE_P(AxisVisual, AxisVisualTest,
INSTANTIATE_TEST_SUITE_P(AxisVisual, AxisVisualTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
9 changes: 1 addition & 8 deletions src/BoundingBox_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <gtest/gtest.h>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)
#include "gz/rendering/BoundingBox.hh"

using namespace gz;
Expand All @@ -32,10 +32,3 @@ TEST(BoundingBoxTest, BoundingBox)
{
BoundingBox box;
}

/////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (MSVC)
endif()

# Create the library target.
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 17)
gz_create_core_library(SOURCES ${sources})

# Include the interface directories that we always need.
#gz_target_interface_include_directories(${PROJECT_LIBRARY_TARGET_NAME}
Expand Down
10 changes: 2 additions & 8 deletions src/COMVisual_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)

#include "gz/rendering/COMVisual.hh"
#include "gz/rendering/RenderEngine.hh"
Expand Down Expand Up @@ -102,12 +102,6 @@ TEST_P(COMVisualTest, COMVisual)
COMVisual(GetParam());
}

INSTANTIATE_TEST_CASE_P(Visual, COMVisualTest,
INSTANTIATE_TEST_SUITE_P(Visual, COMVisualTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/Camera_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)
#include "gz/rendering/Camera.hh"
#include "gz/rendering/GaussianNoisePass.hh"
#include "gz/rendering/RenderEngine.hh"
Expand Down Expand Up @@ -386,12 +386,6 @@ TEST_P(CameraTest, VisibilityMask)
VisibilityMask(GetParam());
}

INSTANTIATE_TEST_CASE_P(Camera, CameraTest,
INSTANTIATE_TEST_SUITE_P(Camera, CameraTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/Capsule_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)
#include "gz/rendering/RenderEngine.hh"
#include "gz/rendering/RenderingIface.hh"
#include "gz/rendering/Capsule.hh"
Expand Down Expand Up @@ -115,12 +115,6 @@ TEST_P(CapsuleTest, Capsule)
Capsule(GetParam());
}

INSTANTIATE_TEST_CASE_P(Capsule, CapsuleTest,
INSTANTIATE_TEST_SUITE_P(Capsule, CapsuleTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/GaussianNoisePass_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)
#include "gz/rendering/GaussianNoisePass.hh"
#include "gz/rendering/RenderEngine.hh"
#include "gz/rendering/RenderingIface.hh"
Expand Down Expand Up @@ -96,12 +96,6 @@ TEST_P(GaussianNoisePassTest, GaussianNoise)
GaussianNoise(GetParam());
}

INSTANTIATE_TEST_CASE_P(GaussianNoise, GaussianNoisePassTest,
INSTANTIATE_TEST_SUITE_P(GaussianNoise, GaussianNoisePassTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/GizmoVisual_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)

#include "gz/rendering/GizmoVisual.hh"
#include "gz/rendering/RenderEngine.hh"
Expand Down Expand Up @@ -208,12 +208,6 @@ TEST_P(GizmoVisualTest, Material)
Material(GetParam());
}

INSTANTIATE_TEST_CASE_P(Visual, GizmoVisualTest,
INSTANTIATE_TEST_SUITE_P(Visual, GizmoVisualTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/Grid_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)
#include "gz/rendering/RenderEngine.hh"
#include "gz/rendering/RenderingIface.hh"
#include "gz/rendering/Grid.hh"
Expand Down Expand Up @@ -94,12 +94,6 @@ TEST_P(GridTest, Grid)
Grid(GetParam());
}

INSTANTIATE_TEST_CASE_P(Grid, GridTest,
INSTANTIATE_TEST_SUITE_P(Grid, GridTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
11 changes: 2 additions & 9 deletions src/Heightmap_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <gz/common/geospatial/ImageHeightmap.hh>
#include <gz/utils/ExtraTestMacros.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)
#include "gz/rendering/RenderEngine.hh"
#include "gz/rendering/RenderingIface.hh"
#include "gz/rendering/Heightmap.hh"
Expand Down Expand Up @@ -353,13 +353,6 @@ TEST_P(HeightmapTest, CopyAssignmentAfterMove)

// TODO(anyone) Running test with Ogre1. Update once Ogre2 is supported.
// https://github.com/gazebosim/gz-rendering/issues/187
INSTANTIATE_TEST_CASE_P(Heightmap, HeightmapTest,
INSTANTIATE_TEST_SUITE_P(Heightmap, HeightmapTest,
::testing::ValuesIn({"ogre"}),
gz::rendering::PrintToStringParam());

/////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/InertiaVisual_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)

#include "gz/rendering/InertiaVisual.hh"
#include "gz/rendering/RenderEngine.hh"
Expand Down Expand Up @@ -81,12 +81,6 @@ TEST_P(InertiaVisualTest, InertiaVisual)
InertiaVisual(GetParam());
}

INSTANTIATE_TEST_CASE_P(Visual, InertiaVisualTest,
INSTANTIATE_TEST_SUITE_P(Visual, InertiaVisualTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/JointVisual_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)

#include "gz/rendering/JointVisual.hh"
#include "gz/rendering/RenderEngine.hh"
Expand Down Expand Up @@ -107,12 +107,6 @@ TEST_P(JointVisualTest, JointVisual)
JointVisual(GetParam());
}

INSTANTIATE_TEST_CASE_P(Visual, JointVisualTest,
INSTANTIATE_TEST_SUITE_P(Visual, JointVisualTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/LidarVisual_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)
#include "gz/rendering/RenderEngine.hh"
#include "gz/rendering/RenderingIface.hh"
#include "gz/rendering/LidarVisual.hh"
Expand Down Expand Up @@ -135,12 +135,6 @@ TEST_P(LidarVisualTest, LidarVisual)
LidarVisual(GetParam());
}

INSTANTIATE_TEST_CASE_P(LidarVisual, LidarVisualTest,
INSTANTIATE_TEST_SUITE_P(LidarVisual, LidarVisualTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/LightVisual_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)

#include "gz/rendering/LightVisual.hh"
#include "gz/rendering/RenderEngine.hh"
Expand Down Expand Up @@ -77,12 +77,6 @@ TEST_P(LightVisualTest, LightVisual)
LightVisual(GetParam());
}

INSTANTIATE_TEST_CASE_P(Visual, LightVisualTest,
INSTANTIATE_TEST_SUITE_P(Visual, LightVisualTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
10 changes: 2 additions & 8 deletions src/Light_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <gz/common/Console.hh>

#include "test_config.h" // NOLINT(build/include)
#include "test_config.hh" // NOLINT(build/include)
#include "gz/rendering/Light.hh"
#include "gz/rendering/RenderEngine.hh"
#include "gz/rendering/RenderingIface.hh"
Expand Down Expand Up @@ -158,12 +158,6 @@ TEST_P(LightTest, Light)
Light(GetParam());
}

INSTANTIATE_TEST_CASE_P(Light, LightTest,
INSTANTIATE_TEST_SUITE_P(Light, LightTest,
RENDER_ENGINE_VALUES,
gz::rendering::PrintToStringParam());

int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Loading

0 comments on commit 67ee5db

Please sign in to comment.