From bf030061e76c0643e708547fcd49046aa8c08ee9 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Fri, 26 Apr 2024 14:56:22 +0200 Subject: [PATCH] Globally assume at least GTest version 1.10.0 It appears ROOT already depends on at least GTest 1.10.0, by using the following in some places without compatibility code: * GTEST_SKIP * TestWithParam with non-default constructible type * The new "test suite" naming instead of the old "test case" (I found at least TYPED_TEST_SUITE and SetUpTestSuite + TearDownTestSuite). Given that an older version is only found on EL8, where we have been using builtin_gtest since a while, I propose to drop the remaining compatibility code. --- hist/hist/test/test_THBinIterator.cxx | 8 +------- math/mathcore/test/stress/testGenVector.cxx | 13 ------------- math/mathcore/test/stress/testSMatrix.cxx | 13 ------------- math/mathcore/test/stress/testVector.cxx | 13 ------------- math/mathcore/test/stress/testVector34.cxx | 13 ------------- math/mathcore/test/testGradient.cxx | 5 ----- math/mathcore/test/testGradientFitting.cxx | 13 ------------- math/mathmore/test/testStress.cxx | 13 ------------- math/vecops/test/vecops_rvec.cxx | 5 ----- roofit/multiprocess/test/test_Job.cxx | 5 ----- roofit/roofitZMQ/test/test_ZMQ.cpp | 5 ----- roofit/roofitcore/test/gtest_wrapper.h | 5 ----- tree/dataframe/test/dataframe_datasetspec.cxx | 5 ----- tree/dataframe/test/dataframe_definepersample.cxx | 5 ----- tree/dataframe/test/dataframe_regression.cxx | 5 ----- tree/dataframe/test/dataframe_samplecallback.cxx | 5 ----- tree/dataframe/test/dataframe_simple.cxx | 5 ----- tree/dataframe/test/dataframe_vary.cxx | 5 ----- tree/ntuple/v7/test/ntuple_test.hxx | 5 ----- tree/readspeed/test/readspeed_general.cxx | 6 ------ tree/tree/test/TOffsetGeneration.cxx | 5 ----- tree/tree/test/friendinfo.cxx | 5 ----- 22 files changed, 1 insertion(+), 161 deletions(-) diff --git a/hist/hist/test/test_THBinIterator.cxx b/hist/hist/test/test_THBinIterator.cxx index c5ea52d23bf22..22812c38ccd46 100644 --- a/hist/hist/test/test_THBinIterator.cxx +++ b/hist/hist/test/test_THBinIterator.cxx @@ -1,11 +1,5 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define SetUpTestSuite SetUpTestCase -#define TearDownTestSuite TearDownTestCase -#endif - // test iterating histogram bins and using the new THistRange and // THBinIterator classes @@ -451,4 +445,4 @@ int main(int argc, char **argv) return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/math/mathcore/test/stress/testGenVector.cxx b/math/mathcore/test/stress/testGenVector.cxx index 4f8fc2d0a94dc..93c0bb6aec3e1 100644 --- a/math/mathcore/test/stress/testGenVector.cxx +++ b/math/mathcore/test/stress/testGenVector.cxx @@ -4,19 +4,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef TYPED_TEST_SUITE_P -#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef REGISTER_TYPED_TEST_SUITE_P -#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TYPED_TEST_SUITE_P -#define INSTANTIATE_TYPED_TEST_SUITE_P INSTANTIATE_TYPED_TEST_CASE_P -#endif - #include "StatFunction.h" #include "TestHelper.h" #include "VectorTest.h" diff --git a/math/mathcore/test/stress/testSMatrix.cxx b/math/mathcore/test/stress/testSMatrix.cxx index 20213cafc97cd..a4d7fc4cd53ec 100644 --- a/math/mathcore/test/stress/testSMatrix.cxx +++ b/math/mathcore/test/stress/testSMatrix.cxx @@ -7,19 +7,6 @@ #include "TestHelper.h" #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef TYPED_TEST_SUITE_P -#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef REGISTER_TYPED_TEST_SUITE_P -#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TYPED_TEST_SUITE_P -#define INSTANTIATE_TYPED_TEST_SUITE_P INSTANTIATE_TYPED_TEST_CASE_P -#endif - #include "VectorTest.h" #include "TROOT.h" #include "TSystem.h" diff --git a/math/mathcore/test/stress/testVector.cxx b/math/mathcore/test/stress/testVector.cxx index b4246de2b936c..72e933f0d5c49 100644 --- a/math/mathcore/test/stress/testVector.cxx +++ b/math/mathcore/test/stress/testVector.cxx @@ -4,19 +4,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef TYPED_TEST_SUITE_P -#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef REGISTER_TYPED_TEST_SUITE_P -#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TYPED_TEST_SUITE_P -#define INSTANTIATE_TYPED_TEST_SUITE_P INSTANTIATE_TYPED_TEST_CASE_P -#endif - #include "StatFunction.h" #include "TestHelper.h" #include "VectorTest.h" diff --git a/math/mathcore/test/stress/testVector34.cxx b/math/mathcore/test/stress/testVector34.cxx index a1b3a4fd588b2..4b311845596cc 100644 --- a/math/mathcore/test/stress/testVector34.cxx +++ b/math/mathcore/test/stress/testVector34.cxx @@ -4,19 +4,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef TYPED_TEST_SUITE_P -#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef REGISTER_TYPED_TEST_SUITE_P -#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TYPED_TEST_SUITE_P -#define INSTANTIATE_TYPED_TEST_SUITE_P INSTANTIATE_TYPED_TEST_CASE_P -#endif - #include "StatFunction.h" #include "VectorTest.h" diff --git a/math/mathcore/test/testGradient.cxx b/math/mathcore/test/testGradient.cxx index 04103e523eb91..49a5391b7bce6 100644 --- a/math/mathcore/test/testGradient.cxx +++ b/math/mathcore/test/testGradient.cxx @@ -22,11 +22,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef TYPED_TEST_SUITE -#define TYPED_TEST_SUITE TYPED_TEST_CASE -#endif - #include #include #include diff --git a/math/mathcore/test/testGradientFitting.cxx b/math/mathcore/test/testGradientFitting.cxx index 1db86fc7c3494..f85f826d9fd58 100644 --- a/math/mathcore/test/testGradientFitting.cxx +++ b/math/mathcore/test/testGradientFitting.cxx @@ -13,19 +13,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef TYPED_TEST_SUITE_P -#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef REGISTER_TYPED_TEST_SUITE_P -#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TYPED_TEST_SUITE_P -#define INSTANTIATE_TYPED_TEST_SUITE_P INSTANTIATE_TYPED_TEST_CASE_P -#endif - #include #include diff --git a/math/mathmore/test/testStress.cxx b/math/mathmore/test/testStress.cxx index a22b1631099d9..47bcdd250fe64 100644 --- a/math/mathmore/test/testStress.cxx +++ b/math/mathmore/test/testStress.cxx @@ -26,19 +26,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef TYPED_TEST_SUITE_P -#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef REGISTER_TYPED_TEST_SUITE_P -#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P -#endif -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TYPED_TEST_SUITE_P -#define INSTANTIATE_TYPED_TEST_SUITE_P INSTANTIATE_TYPED_TEST_CASE_P -#endif - using ::testing::TestWithParam; using ::testing::Values; diff --git a/math/vecops/test/vecops_rvec.cxx b/math/vecops/test/vecops_rvec.cxx index a903d4610dced..e1ed29b150c22 100644 --- a/math/vecops/test/vecops_rvec.cxx +++ b/math/vecops/test/vecops_rvec.cxx @@ -13,11 +13,6 @@ #include #include -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - using namespace ROOT; using namespace ROOT::VecOps; using namespace ROOT::Detail::VecOps; // for `IsSmall` and `IsAdopting` diff --git a/roofit/multiprocess/test/test_Job.cxx b/roofit/multiprocess/test/test_Job.cxx index ed4b131ee74d1..e7dcb4b0ab2e8 100644 --- a/roofit/multiprocess/test/test_Job.cxx +++ b/roofit/multiprocess/test/test_Job.cxx @@ -25,11 +25,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - #include "utils.h" class xSquaredPlusBVectorSerial { diff --git a/roofit/roofitZMQ/test/test_ZMQ.cpp b/roofit/roofitZMQ/test/test_ZMQ.cpp index cbf1f2fba1691..94b100c6ef756 100644 --- a/roofit/roofitZMQ/test/test_ZMQ.cpp +++ b/roofit/roofitZMQ/test/test_ZMQ.cpp @@ -16,11 +16,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - #include // fork, usleep #include diff --git a/roofit/roofitcore/test/gtest_wrapper.h b/roofit/roofitcore/test/gtest_wrapper.h index 30f9e66cd07eb..3528daf08ff1e 100644 --- a/roofit/roofitcore/test/gtest_wrapper.h +++ b/roofit/roofitcore/test/gtest_wrapper.h @@ -3,11 +3,6 @@ #include -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - #ifdef ROOFIT_LEGACY_EVAL_BACKEND #define ROOFIT_EVAL_BACKEND_LEGACY RooFit::EvalBackend::Legacy(), #else diff --git a/tree/dataframe/test/dataframe_datasetspec.cxx b/tree/dataframe/test/dataframe_datasetspec.cxx index 1291376f0ed7e..185f6e7a13ba4 100644 --- a/tree/dataframe/test/dataframe_datasetspec.cxx +++ b/tree/dataframe/test/dataframe_datasetspec.cxx @@ -1,10 +1,5 @@ #include -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - #include #include #include diff --git a/tree/dataframe/test/dataframe_definepersample.cxx b/tree/dataframe/test/dataframe_definepersample.cxx index 32a4c9076382e..61c9fca902c6f 100644 --- a/tree/dataframe/test/dataframe_definepersample.cxx +++ b/tree/dataframe/test/dataframe_definepersample.cxx @@ -6,11 +6,6 @@ #include -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - #include #include #include // std::thread::hardware_concurrency diff --git a/tree/dataframe/test/dataframe_regression.cxx b/tree/dataframe/test/dataframe_regression.cxx index f4061843d62ef..a9cb14c574044 100644 --- a/tree/dataframe/test/dataframe_regression.cxx +++ b/tree/dataframe/test/dataframe_regression.cxx @@ -10,11 +10,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - // Fixture for all tests in this file. If parameter is true, run with implicit MT, else run sequentially class RDFRegressionTests : public ::testing::TestWithParam { protected: diff --git a/tree/dataframe/test/dataframe_samplecallback.cxx b/tree/dataframe/test/dataframe_samplecallback.cxx index 2f5641bb6900c..c7790227ab23c 100644 --- a/tree/dataframe/test/dataframe_samplecallback.cxx +++ b/tree/dataframe/test/dataframe_samplecallback.cxx @@ -11,11 +11,6 @@ #include -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - #include // std::min #include #include diff --git a/tree/dataframe/test/dataframe_simple.cxx b/tree/dataframe/test/dataframe_simple.cxx index e60fec1262f32..41c246e1e84c1 100644 --- a/tree/dataframe/test/dataframe_simple.cxx +++ b/tree/dataframe/test/dataframe_simple.cxx @@ -1,11 +1,6 @@ /****** Run RDataFrame tests both with and without IMT enabled *******/ #include -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - #include #include #include diff --git a/tree/dataframe/test/dataframe_vary.cxx b/tree/dataframe/test/dataframe_vary.cxx index e31f89f60ffbe..cb01d94996fbb 100644 --- a/tree/dataframe/test/dataframe_vary.cxx +++ b/tree/dataframe/test/dataframe_vary.cxx @@ -12,11 +12,6 @@ #include -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - using ROOT::RDF::Experimental::VariationsFor; class RDFVary : public ::testing::TestWithParam { diff --git a/tree/ntuple/v7/test/ntuple_test.hxx b/tree/ntuple/v7/test/ntuple_test.hxx index 3f06e93154b83..b9c8ad119e64f 100644 --- a/tree/ntuple/v7/test/ntuple_test.hxx +++ b/tree/ntuple/v7/test/ntuple_test.hxx @@ -36,11 +36,6 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef TYPED_TEST_SUITE -#define TYPED_TEST_SUITE TYPED_TEST_CASE -#endif - #include "CustomStruct.hxx" #include diff --git a/tree/readspeed/test/readspeed_general.cxx b/tree/readspeed/test/readspeed_general.cxx index 9467c3685dafe..2115ed120644e 100644 --- a/tree/readspeed/test/readspeed_general.cxx +++ b/tree/readspeed/test/readspeed_general.cxx @@ -1,11 +1,5 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define SetUpTestSuite SetUpTestCase -#define TearDownTestSuite TearDownTestCase -#endif - #include "ReadSpeed.hxx" #include "ReadSpeedCLI.hxx" diff --git a/tree/tree/test/TOffsetGeneration.cxx b/tree/tree/test/TOffsetGeneration.cxx index 1406d619a19e7..fde37258e5504 100644 --- a/tree/tree/test/TOffsetGeneration.cxx +++ b/tree/tree/test/TOffsetGeneration.cxx @@ -11,11 +11,6 @@ #include "ROOT/TestSupport.hxx" #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define SetUpTestSuite SetUpTestCase -#endif - #include "ElementStruct.h" class TOffsetGeneration : public ::testing::Test { diff --git a/tree/tree/test/friendinfo.cxx b/tree/tree/test/friendinfo.cxx index 2a57b57c2d24d..eed41581cd3ab 100644 --- a/tree/tree/test/friendinfo.cxx +++ b/tree/tree/test/friendinfo.cxx @@ -11,11 +11,6 @@ #include "gtest/gtest.h" -// Backward compatibility for gtest version < 1.10.0 -#ifndef INSTANTIATE_TEST_SUITE_P -#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P -#endif - namespace { template