Skip to content

Commit

Permalink
Replace INSTANTIATE_TEST_CASE_P by INSTANTIATE_TEST_SUITE_P (#752)
Browse files Browse the repository at this point in the history
INSTANTIATE_TEST_CASE_P is deprecated in newer version of GTest and
should be replaced by INSTANTIATE_TEST_SUITE_P

Unfortunately on CentOS7, default GTest is too old for
INSTANTIATE_TEST_SUITE_P. We need to build it from sources
  • Loading branch information
JasonMarechal25 authored Jan 25, 2024
1 parent cc74b45 commit 1f75ce3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
with:
submodules: true

- uses: ./.github/workflows/compile-gtest
- name: Checkout xpressmp linux
uses: actions/checkout@v3
with:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/compile-gtest/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Download and build gtest"
description: "build gtest for centos7"
runs:
using: "composite"
steps:
- id: build-gtest
shell: bash
run: |
source /opt/rh/devtoolset-10/enable
git clone -b v1.14.0 https://github.com/google/googletest.git
cd googletest
cmake3 -G"Unix Makefiles"
make -j8
make install
4 changes: 2 additions & 2 deletions tests/cpp/full_run/FullRunTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ auto GetData() {
{"benders_by_batch", BENDERSMETHOD::BENDERSBYBATCH},
{"mergeMPS", BENDERSMETHOD::MERGEMPS}});
}
INSTANTIATE_TEST_CASE_P(Method, FullRunOptionsParserTestParameterizedMethod,
GetData());
INSTANTIATE_TEST_SUITE_P(Method, FullRunOptionsParserTestParameterizedMethod,
GetData());
3 changes: 2 additions & 1 deletion tests/cpp/lp_namer/ProblemConstructionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ TEST_P(ProblemConstructionTest, ExtractSeveralFileNameCase) {
auto const& input = GetParam();
EXPECT_EQ(MCYear(input.problem_name), input.expected_mc_year);
}
INSTANTIATE_TEST_CASE_P(BulkTest, ProblemConstructionTest, testing::ValuesIn(cases));
INSTANTIATE_TEST_SUITE_P(BulkTest, ProblemConstructionTest,
testing::ValuesIn(cases));

TEST_F(ProblemConstructionTest, ExtractMCYearFromPath) {
std::filesystem::path path = std::filesystem::path("path") / "To" / "inner-dir" / "problem-2-1-20220214-124051.mps";
Expand Down

0 comments on commit 1f75ce3

Please sign in to comment.