Skip to content

Commit

Permalink
Globally assume at least GTest version 1.10.0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hahnjo committed Apr 30, 2024
1 parent 049d145 commit bf03006
Show file tree
Hide file tree
Showing 22 changed files with 1 addition and 161 deletions.
8 changes: 1 addition & 7 deletions hist/hist/test/test_THBinIterator.cxx
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -451,4 +445,4 @@ int main(int argc, char **argv)


return RUN_ALL_TESTS();
}
}
13 changes: 0 additions & 13 deletions math/mathcore/test/stress/testGenVector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 0 additions & 13 deletions math/mathcore/test/stress/testSMatrix.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 0 additions & 13 deletions math/mathcore/test/stress/testVector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 0 additions & 13 deletions math/mathcore/test/stress/testVector34.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 0 additions & 5 deletions math/mathcore/test/testGradient.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <chrono>
#include <iostream>
#include <string>
Expand Down
13 changes: 0 additions & 13 deletions math/mathcore/test/testGradientFitting.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <iostream>
#include <string>

Expand Down
13 changes: 0 additions & 13 deletions math/mathmore/test/testStress.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 0 additions & 5 deletions math/vecops/test/vecops_rvec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
#include <sstream>
#include <cmath>

// 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`
Expand Down
5 changes: 0 additions & 5 deletions roofit/multiprocess/test/test_Job.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions roofit/roofitZMQ/test/test_ZMQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <unistd.h> // fork, usleep

#include <sstream>
Expand Down
5 changes: 0 additions & 5 deletions roofit/roofitcore/test/gtest_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,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

#ifdef ROOFIT_LEGACY_EVAL_BACKEND
#define ROOFIT_EVAL_BACKEND_LEGACY RooFit::EvalBackend::Legacy(),
#else
Expand Down
5 changes: 0 additions & 5 deletions tree/dataframe/test/dataframe_datasetspec.cxx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#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 <ROOT/RDataFrame.hxx>
#include <ROOT/RVec.hxx>
#include <ROOT/RDFHelpers.hxx>
Expand Down
5 changes: 0 additions & 5 deletions tree/dataframe/test/dataframe_definepersample.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,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 <atomic>
#include <memory>
#include <thread> // std::thread::hardware_concurrency
Expand Down
5 changes: 0 additions & 5 deletions tree/dataframe/test/dataframe_regression.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> {
protected:
Expand Down
5 changes: 0 additions & 5 deletions tree/dataframe/test/dataframe_samplecallback.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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

#include <algorithm> // std::min
#include <memory>
#include <mutex>
Expand Down
5 changes: 0 additions & 5 deletions tree/dataframe/test/dataframe_simple.cxx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/****** Run RDataFrame tests both with and without IMT enabled *******/
#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 <ROOT/TestSupport.hxx>
#include <ROOT/RDataFrame.hxx>
#include <ROOT/TSeq.hxx>
Expand Down
5 changes: 0 additions & 5 deletions tree/dataframe/test/dataframe_vary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,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

using ROOT::RDF::Experimental::VariationsFor;

class RDFVary : public ::testing::TestWithParam<bool> {
Expand Down
5 changes: 0 additions & 5 deletions tree/ntuple/v7/test/ntuple_test.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <array>
Expand Down
6 changes: 0 additions & 6 deletions tree/readspeed/test/readspeed_general.cxx
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
5 changes: 0 additions & 5 deletions tree/tree/test/TOffsetGeneration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions tree/tree/test/friendinfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
Expand Down

0 comments on commit bf03006

Please sign in to comment.