Commit c790aaec authored by Edwin Carlinet's avatar Edwin Carlinet

Upgrade GTest to 1.8.2 as conan deps.

* Rename deprecated GTest TEST_CASE in TEST_SUITE.
* GTest is set as a conan build depedancy
parent e1f8c70e
include(CTest)
find_package(Threads REQUIRED)
find_package(GTest MODULE REQUIRED)
find_package(GTest REQUIRED)
add_executable(UTBenchImpl_Neighborhood neighborhood.cpp)
target_link_libraries(UTBenchImpl_Neighborhood PRIVATE BenchImpl Fixtures::ImagePath Fixtures::ImageCompare Pylene::Pylene GTest::GTest GTest::Main ${FreeImage_LIBRARIES})
target_link_libraries(UTBenchImpl_Neighborhood PRIVATE BenchImpl Fixtures::ImagePath Fixtures::ImageCompare Pylene::Pylene GTest::GTest ${FreeImage_LIBRARIES})
add_test(NAME UTBenchImpl_Neighborhood COMMAND UTBenchImpl_Neighborhood --gtest_output=xml:UTBenchImpl_Neighborhood.xml WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bench/tests)
......
......@@ -11,19 +11,17 @@ class Pylene(ConanFile):
options = {
"shared": [True, False],
"fPIC": [True, False],
"gtest": [True, False],
"benchmark": [True, False],
"freeimage": [True, False],
"boost": [True, False],
"boost_program_options": [True, False]}
"boost": [True, False]}
default_options = {
"shared": False,
"fPIC": False,
"gtest": False,
"benchmark": False,
"freeimage": False,
"boost": False,
"boost_program_options": False}
"gtest:shared": False
}
generators = [ "cmake", "cmake_paths", "cmake_find_package" ]
exports_sources = ["pylene/*", "cmake/*", "CMakeLists.txt", "LICENSE"]
......@@ -43,17 +41,20 @@ class Pylene(ConanFile):
if self.settings.compiler in ["gcc", "clang"]:
self.cpp_info.cppflags = ["-std=c++20"]
# developer dependancies (to be removed)
def build_requirements(self):
self.build_requires("gtest/[>=1.10]", force_host_context=True)
# Requirements part of the INTERFACE
def requirements(self):
self.requires("range-v3/0.10.0@ericniebler/stable")
self.requires("fmt/6.0.0")
if self.options.freeimage:
self.requires("freeimage/3.18.0@dutiona/stable")
if self.options.gtest:
self.requires("gtest/1.8.1")
if self.options.benchmark:
self.requires("benchmark/1.5.0")
......
project(tests)
find_package(Threads REQUIRED)
find_package(GTest MODULE REQUIRED)
find_package(GTest 1.10 REQUIRED)
find_package(Sanitizers REQUIRED)
sanitizer_add_blacklist_file(${CMAKE_SOURCE_DIR}"/utils/sanitizers/blacklist.txt")
......@@ -15,9 +15,9 @@ function(add_core_test Executable)
add_executable(${core_test_NAME} ${core_test_SOURCES})
add_test(NAME ${core_test_NAME} COMMAND ${core_test_NAME} --gtest_output=xml:${core_test_NAME}.xml WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
target_link_libraries(${core_test_NAME} PRIVATE Fixtures::ImagePath Fixtures::ImageCompare Pylene::Pylene GTest::GTest GTest::Main ${FreeImage_LIBRARIES})
target_link_libraries(${core_test_NAME} PRIVATE Fixtures::ImagePath Fixtures::ImageCompare Pylene::Pylene GTest::GTest ${FreeImage_LIBRARIES})
set_tests_properties(${core_test_NAME} PROPERTIES LABELS UnitTests)
add_sanitizers(${core_test_NAME})
add_dependencies(build-tests ${core_test_NAME})
......
......@@ -102,7 +102,7 @@ public:
using MyTypes = ::testing::Types<std::array<int, 1>, std::array<int, 2>, std::array<int, 3>, std::array<int, 4>,
std::array<std::uint8_t, 4>>;
TYPED_TEST_CASE(MultiIndicesTest, MyTypes);
TYPED_TEST_SUITE(MultiIndicesTest, MyTypes);
......
......@@ -99,7 +99,7 @@ public:
using MyTypes = ::testing::Types<std::array<int, 1>, std::array<int, 2>, std::array<int, 3>, std::array<int, 4>>;
TYPED_TEST_CASE(MdspanTest, MyTypes);
TYPED_TEST_SUITE(MdspanTest, MyTypes);
TYPED_TEST(MdspanTest, forward)
{
......
......@@ -129,7 +129,7 @@ TEST_P(RunningMin1D, check)
INSTANTIATE_TEST_CASE_P(se_leq_size, RunningMax1D,
INSTANTIATE_TEST_SUITE_P(se_leq_size, RunningMax1D,
::testing::Values(std::make_tuple(0, 0), // Identity
std::make_tuple(12, 0), // Identity
std::make_tuple(12, 1), // radius = 1
......@@ -140,9 +140,9 @@ INSTANTIATE_TEST_CASE_P(se_leq_size, RunningMax1D,
std::make_tuple(14, 3), // radius = 3
std::make_tuple(13, 6))); // n == k
INSTANTIATE_TEST_CASE_P(se_ge_size_, RunningMax1D, ::testing::Values(std::make_tuple(12, 6)));
INSTANTIATE_TEST_SUITE_P(se_ge_size_, RunningMax1D, ::testing::Values(std::make_tuple(12, 6)));
INSTANTIATE_TEST_CASE_P(se_leq_size, RunningMin1D,
INSTANTIATE_TEST_SUITE_P(se_leq_size, RunningMin1D,
::testing::Values(std::make_tuple(0, 0), // Identity
std::make_tuple(12, 0), // Identity
std::make_tuple(12, 1), // radius = 1
......@@ -153,5 +153,5 @@ INSTANTIATE_TEST_CASE_P(se_leq_size, RunningMin1D,
std::make_tuple(14, 3), // radius = 3
std::make_tuple(13, 6))); // n == k
INSTANTIATE_TEST_CASE_P(se_ge_size_, RunningMin1D, ::testing::Values(std::make_tuple(12, 6)));
INSTANTIATE_TEST_SUITE_P(se_ge_size_, RunningMin1D, ::testing::Values(std::make_tuple(12, 6)));
......@@ -121,7 +121,7 @@ class ToSPropagation : public ::testing::Test
};
typedef ::testing::Types<uint8_t> TestValueTypes;
TYPED_TEST_CASE(ToSPropagation, TestValueTypes);
TYPED_TEST_SUITE(ToSPropagation, TestValueTypes);
TYPED_TEST(ToSPropagation, saddle_point)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment