Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GoogleTest to latest version #241

Merged
merged 7 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ find_package(gz-cmake3 REQUIRED)
#============================================================================
# Configure the project
#============================================================================
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/sensors
VERSION_SUFFIX pre1)
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ if (MSVC)
endif()

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

gz_create_core_library(SOURCES ${sources})
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER}
Expand Down
7 changes: 0 additions & 7 deletions src/Camera_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,3 @@ TEST(Camera_TEST, Topic)
EXPECT_EQ(nullptr, sensor);
}
}

//////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions src/ImuSensor_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,3 @@ TEST(ImuSensor_TEST, LocalizationTagInvalid)
math::Quaterniond orientValue(math::Vector3d(0, 0, 0));
EXPECT_EQ(orientValue, sensor->Orientation());
}

//////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions src/Lidar_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,3 @@ TEST(Lidar_TEST, CreateLaser)

EXPECT_TRUE(sensor->IsActive());
}

//////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions src/Manager_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,3 @@ TEST_F(Manager_TEST, RemoveSensor)

EXPECT_TRUE(mgr.Remove(createdSensor->Id()));
}

//////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions src/Noise_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,3 @@ TEST(NoiseTest, OnApplyNoise)
EXPECT_DOUBLE_EQ(value, i*2);
}
}

/////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions src/Sensor_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,3 @@ TEST_F(SensorUpdate, NextDataUpdateTime)
EXPECT_EQ(newNext.count(), sensor->NextDataUpdateTime().count());
}
}

//////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
9 changes: 1 addition & 8 deletions src/Util_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <sdf/Model.hh>
#include <sdf/World.hh>

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

/// \brief Test Util functions
Expand Down Expand Up @@ -90,10 +90,3 @@ TEST_F(Util_TEST, customType)
sdf::ElementPtr ptr{nullptr};
EXPECT_TRUE(customType(ptr).empty());
}

//////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
21 changes: 5 additions & 16 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
configure_file (test_config.hh.in
${PROJECT_BINARY_DIR}/include/test_config.hh
)
include_directories (
${PROJECT_SOURCE_DIR}/test/gtest/include
${PROJECT_SOURCE_DIR}/test/gtest
${PROJECT_SOURCE_DIR}/test
${PROJECT_BINARY_DIR}/include
)

configure_file (test_config.h.in ${PROJECT_BINARY_DIR}/test_config.h)

# Build gtest
add_library(gtest STATIC gtest/src/gtest-all.cc)
add_library(gtest_main STATIC gtest/src/gtest_main.cc)
target_link_libraries(gtest_main gtest)
set(GTEST_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest.a")
set(GTEST_MAIN_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest_main.a")

execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_results)
execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results)
include_directories(${GTEST_INCLUDE_DIRS})

add_subdirectory(gtest_vendor)
add_subdirectory(integration)
add_subdirectory(performance)
add_subdirectory(regression)
Loading