From 99e9ad9ea54369296537ceb012ccdcb333b5f513 Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Sat, 26 Mar 2022 10:55:38 +0100
Subject: [PATCH 2/2] Backward compatibility with older googletest versions in
EPEL
---
hist/hist/test/test_THBinIterator.cxx | 5 +++++
math/mathcore/test/stress/testGenVector.cxx | 10 ++++++++++
math/mathcore/test/stress/testSMatrix.cxx | 10 ++++++++++
math/mathcore/test/stress/testVector.cxx | 10 ++++++++++
math/mathcore/test/stress/testVector34.cxx | 10 ++++++++++
math/mathcore/test/testGradient.cxx | 4 ++++
math/mathcore/test/testGradientFitting.cxx | 10 ++++++++++
math/mathmore/test/testStress.cxx | 10 ++++++++++
roofit/histfactory/test/testHistFactory.cxx | 4 ++++
roofit/multiprocess/test/test_Job.cxx | 5 +++++
roofit/roofitZMQ/test/test_ZMQ.cpp | 4 ++++
roofit/roofitcore/test/TestStatistics/RooRealL.cpp | 4 ++++
.../test/TestStatistics/testLikelihoodGradientJob.cpp | 5 +++++
roofit/roofitcore/test/testProxiesAndCategories.cxx | 3 +++
roofit/roofitcore/test/testRooDataHist.cxx | 4 ++++
roofit/roofitcore/test/testRooGradMinimizerFcn.cxx | 5 +++++
tree/dataframe/test/dataframe_definepersample.cxx | 4 ++++
tree/dataframe/test/dataframe_merge_results.cxx | 2 +-
tree/dataframe/test/dataframe_regression.cxx | 4 ++++
tree/dataframe/test/dataframe_samplecallback.cxx | 4 ++++
tree/dataframe/test/dataframe_simple.cxx | 5 +++++
tree/dataframe/test/dataframe_vary.cxx | 4 ++++
tree/tree/test/TOffsetGeneration.cxx | 4 ++++
23 files changed, 129 insertions(+), 1 deletion(-)
diff --git a/hist/hist/test/test_THBinIterator.cxx b/hist/hist/test/test_THBinIterator.cxx
index e30585b8cb..04f1e1487b 100644
--- a/hist/hist/test/test_THBinIterator.cxx
+++ b/hist/hist/test/test_THBinIterator.cxx
@@ -1,5 +1,10 @@
#include "gtest/gtest.h"
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define SetUpTestSuite SetUpTestCase
+#define TearDownTestSuite TearDownTestCase
+#endif
+
// test iterating histogram bins and using the new THistRange and
// THBinIterator classes
diff --git a/math/mathcore/test/stress/testGenVector.cxx b/math/mathcore/test/stress/testGenVector.cxx
index 93c0bb6aec..b3259158da 100644
--- a/math/mathcore/test/stress/testGenVector.cxx
+++ b/math/mathcore/test/stress/testGenVector.cxx
@@ -4,6 +4,16 @@
#include "gtest/gtest.h"
+#ifndef TYPED_TEST_SUITE_P
+#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P
+#endif
+#ifndef REGISTER_TYPED_TEST_SUITE_P
+#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P
+#endif
+#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 a4d7fc4cd5..a35d88b7c2 100644
--- a/math/mathcore/test/stress/testSMatrix.cxx
+++ b/math/mathcore/test/stress/testSMatrix.cxx
@@ -7,6 +7,16 @@
#include "TestHelper.h"
#include "gtest/gtest.h"
+#ifndef TYPED_TEST_SUITE_P
+#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P
+#endif
+#ifndef REGISTER_TYPED_TEST_SUITE_P
+#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P
+#endif
+#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 72e933f0d5..938e27d83c 100644
--- a/math/mathcore/test/stress/testVector.cxx
+++ b/math/mathcore/test/stress/testVector.cxx
@@ -4,6 +4,16 @@
#include "gtest/gtest.h"
+#ifndef TYPED_TEST_SUITE_P
+#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P
+#endif
+#ifndef REGISTER_TYPED_TEST_SUITE_P
+#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P
+#endif
+#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 4b31184559..80d6dd6314 100644
--- a/math/mathcore/test/stress/testVector34.cxx
+++ b/math/mathcore/test/stress/testVector34.cxx
@@ -4,6 +4,16 @@
#include "gtest/gtest.h"
+#ifndef TYPED_TEST_SUITE_P
+#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P
+#endif
+#ifndef REGISTER_TYPED_TEST_SUITE_P
+#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P
+#endif
+#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 49a5391b7b..271e89e43c 100644
--- a/math/mathcore/test/testGradient.cxx
+++ b/math/mathcore/test/testGradient.cxx
@@ -22,6 +22,10 @@
#include "gtest/gtest.h"
+#ifndef TYPED_TEST_SUITE
+#define TYPED_TEST_SUITE TYPED_TEST_CASE
+#endif
+
#include <chrono>
#include <iostream>
#include <string>
diff --git a/math/mathcore/test/testGradientFitting.cxx b/math/mathcore/test/testGradientFitting.cxx
index f85f826d9f..1818d1c22f 100644
--- a/math/mathcore/test/testGradientFitting.cxx
+++ b/math/mathcore/test/testGradientFitting.cxx
@@ -13,6 +13,16 @@
#include "gtest/gtest.h"
+#ifndef TYPED_TEST_SUITE_P
+#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P
+#endif
+#ifndef REGISTER_TYPED_TEST_SUITE_P
+#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P
+#endif
+#ifndef INSTANTIATE_TYPED_TEST_SUITE_P
+#define INSTANTIATE_TYPED_TEST_SUITE_P INSTANTIATE_TYPED_TEST_CASE_P
+#endif
+
#include <iostream>
#include <string>
diff --git a/math/mathmore/test/testStress.cxx b/math/mathmore/test/testStress.cxx
index 47bcdd250f..5cf20e69a1 100644
--- a/math/mathmore/test/testStress.cxx
+++ b/math/mathmore/test/testStress.cxx
@@ -26,6 +26,16 @@
#include "gtest/gtest.h"
+#ifndef TYPED_TEST_SUITE_P
+#define TYPED_TEST_SUITE_P TYPED_TEST_CASE_P
+#endif
+#ifndef REGISTER_TYPED_TEST_SUITE_P
+#define REGISTER_TYPED_TEST_SUITE_P REGISTER_TYPED_TEST_CASE_P
+#endif
+#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/roofit/histfactory/test/testHistFactory.cxx b/roofit/histfactory/test/testHistFactory.cxx
index 71d7b632d2..9063e51070 100644
--- a/roofit/histfactory/test/testHistFactory.cxx
+++ b/roofit/histfactory/test/testHistFactory.cxx
@@ -22,6 +22,10 @@
#include "TCanvas.h"
#include "gtest/gtest.h"
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
#include <set>
using namespace RooStats;
diff --git a/roofit/multiprocess/test/test_Job.cxx b/roofit/multiprocess/test/test_Job.cxx
index 22e66fc73c..61cc11771d 100644
--- a/roofit/multiprocess/test/test_Job.cxx
+++ b/roofit/multiprocess/test/test_Job.cxx
@@ -24,6 +24,11 @@
#include "RooFit/MultiProcess/Queue.h" // ... JobManager::queue()
#include "gtest/gtest.h"
+
+#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 6dcceaff08..73e75be147 100644
--- a/roofit/roofitZMQ/test/test_ZMQ.cpp
+++ b/roofit/roofitZMQ/test/test_ZMQ.cpp
@@ -16,6 +16,10 @@
#include "gtest/gtest.h"
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
#include <unistd.h> // fork, usleep
#include <sstream>
diff --git a/roofit/roofitcore/test/TestStatistics/RooRealL.cpp b/roofit/roofitcore/test/TestStatistics/RooRealL.cpp
index f8421613ac..3ae6285a12 100644
--- a/roofit/roofitcore/test/TestStatistics/RooRealL.cpp
+++ b/roofit/roofitcore/test/TestStatistics/RooRealL.cpp
@@ -34,6 +34,10 @@
#include "gtest/gtest.h"
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
class RooRealL
: public ::testing::TestWithParam<std::tuple<std::size_t>> {
};
diff --git a/roofit/roofitcore/test/TestStatistics/testLikelihoodGradientJob.cpp b/roofit/roofitcore/test/TestStatistics/testLikelihoodGradientJob.cpp
index f4adf63eec..05164277f0 100644
--- a/roofit/roofitcore/test/TestStatistics/testLikelihoodGradientJob.cpp
+++ b/roofit/roofitcore/test/TestStatistics/testLikelihoodGradientJob.cpp
@@ -33,6 +33,11 @@
#include <stdexcept> // runtime_error
#include "gtest/gtest.h"
+
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
#include "../test_lib.h" // generate_1D_gaussian_pdf_nll
using RooFit::TestStatistics::LikelihoodWrapper;
diff --git a/roofit/roofitcore/test/testProxiesAndCategories.cxx b/roofit/roofitcore/test/testProxiesAndCategories.cxx
index bed3c399bb..550e0c5ac9 100644
--- a/roofit/roofitcore/test/testProxiesAndCategories.cxx
+++ b/roofit/roofitcore/test/testProxiesAndCategories.cxx
@@ -16,6 +16,9 @@
#include "gtest/gtest.h"
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
TEST(RooCategory, CategoryDefineMultiState) {
RooCategory myCat("myCat", "A category", { {"0Lep", 0}, {"1Lep", 1}, {"2Lep", 2}, {"3Lep", 3} });
diff --git a/roofit/roofitcore/test/testRooDataHist.cxx b/roofit/roofitcore/test/testRooDataHist.cxx
index 90782e0749..f6b5e087ae 100644
--- a/roofit/roofitcore/test/testRooDataHist.cxx
+++ b/roofit/roofitcore/test/testRooDataHist.cxx
@@ -18,6 +18,10 @@
#include "gtest/gtest.h"
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
#include <algorithm>
#include <memory>
diff --git a/roofit/roofitcore/test/testRooGradMinimizerFcn.cxx b/roofit/roofitcore/test/testRooGradMinimizerFcn.cxx
index c1978ae47e..877ab1525f 100644
--- a/roofit/roofitcore/test/testRooGradMinimizerFcn.cxx
+++ b/roofit/roofitcore/test/testRooGradMinimizerFcn.cxx
@@ -22,6 +22,11 @@
#include <stdio.h> // remove redundant workspace files
#include "gtest/gtest.h"
+
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
#include "test_lib.h"
#include <RooMsgService.h>
diff --git a/tree/dataframe/test/dataframe_definepersample.cxx b/tree/dataframe/test/dataframe_definepersample.cxx
index 772b8baa70..37da9f3f95 100644
--- a/tree/dataframe/test/dataframe_definepersample.cxx
+++ b/tree/dataframe/test/dataframe_definepersample.cxx
@@ -6,6 +6,10 @@
#include <gtest/gtest.h>
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
#include <atomic>
#include <memory>
#include <thread> // std::thread::hardware_concurrency
diff --git a/tree/dataframe/test/dataframe_merge_results.cxx b/tree/dataframe/test/dataframe_merge_results.cxx
index 9354b75a39..ea439ea006 100644
--- a/tree/dataframe/test/dataframe_merge_results.cxx
+++ b/tree/dataframe/test/dataframe_merge_results.cxx
@@ -340,7 +340,7 @@ TEST(RDataFrameMergeResults, Merge5Hists)
EXPECT_FALSE(mh3);
EXPECT_FALSE(mh4);
EXPECT_FALSE(mh5);
- EXPECT_TRUE(mergedptr);
+ EXPECT_TRUE(!!mergedptr);
const auto &mh = mergedptr->GetValue();
diff --git a/tree/dataframe/test/dataframe_regression.cxx b/tree/dataframe/test/dataframe_regression.cxx
index 9801067cf4..8a991f40c5 100644
--- a/tree/dataframe/test/dataframe_regression.cxx
+++ b/tree/dataframe/test/dataframe_regression.cxx
@@ -9,6 +9,10 @@
#include "gtest/gtest.h"
+#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<bool> {
protected:
diff --git a/tree/dataframe/test/dataframe_samplecallback.cxx b/tree/dataframe/test/dataframe_samplecallback.cxx
index 188d58dd31..7734586eb3 100644
--- a/tree/dataframe/test/dataframe_samplecallback.cxx
+++ b/tree/dataframe/test/dataframe_samplecallback.cxx
@@ -11,6 +11,10 @@
#include <gtest/gtest.h>
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
#include <algorithm> // std::min
#include <memory>
#include <mutex>
diff --git a/tree/dataframe/test/dataframe_simple.cxx b/tree/dataframe/test/dataframe_simple.cxx
index 6006f99017..b507edc13f 100644
--- a/tree/dataframe/test/dataframe_simple.cxx
+++ b/tree/dataframe/test/dataframe_simple.cxx
@@ -1,5 +1,10 @@
/****** Run RDataFrame tests both with and without IMT enabled *******/
#include <gtest/gtest.h>
+
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
+#endif
+
#include <ROOTUnitTestSupport.h>
#include <ROOT/RDataFrame.hxx>
#include <ROOT/TSeq.hxx>
diff --git a/tree/dataframe/test/dataframe_vary.cxx b/tree/dataframe/test/dataframe_vary.cxx
index 2284b21f53..5a26c43cdc 100644
--- a/tree/dataframe/test/dataframe_vary.cxx
+++ b/tree/dataframe/test/dataframe_vary.cxx
@@ -7,6 +7,10 @@
#include <gtest/gtest.h>
+#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<bool> {
diff --git a/tree/tree/test/TOffsetGeneration.cxx b/tree/tree/test/TOffsetGeneration.cxx
index 7b6b7647aa..77f125ca60 100644
--- a/tree/tree/test/TOffsetGeneration.cxx
+++ b/tree/tree/test/TOffsetGeneration.cxx
@@ -9,6 +9,10 @@
#include "ROOTUnitTestSupport.h"
#include "gtest/gtest.h"
+#ifndef INSTANTIATE_TEST_SUITE_P
+#define SetUpTestSuite SetUpTestCase
+#endif
+
#include "ElementStruct.h"
class TOffsetGeneration : public ::testing::Test {
--
2.35.1
From 33e5da8c1f678382ab2fd65d000d388bb0dbf3ab Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Sun, 17 Apr 2022 22:17:56 +0200
Subject: [PATCH] Backward compatibility with older googletest versions in EPEL
---
math/vecops/test/vecops_rvec.cxx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/math/vecops/test/vecops_rvec.cxx b/math/vecops/test/vecops_rvec.cxx
index 7b513a858b..bea39636ce 100644
--- a/math/vecops/test/vecops_rvec.cxx
+++ b/math/vecops/test/vecops_rvec.cxx
@@ -13,6 +13,10 @@
#include <sstream>
#include <cmath>
+#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`
--
2.35.1