Skip to content

[c++] googletest tests fail on newer versions of googletest which dropped C++11 support #5976

Closed
@yurivict

Description

Description

Failure message:

In file included from /usr/ports/misc/lightgbm/work/LightGBM-4.0.0/tests/cpp_tests/test_main.cpp:5:
In file included from /usr/local/include/gtest/gtest.h:64:
In file included from /usr/local/include/gtest/gtest-assertion-result.h:46:
In file included from /usr/local/include/gtest/gtest-message.h:57:
/usr/local/include/gtest/internal/gtest-port.h:270:2: error: C++ versions less than C++14 are not supported.
#error C++ versions less than C++14 are not supported.
 ^
In file included from /usr/ports/misc/lightgbm/work/LightGBM-4.0.0/tests/cpp_tests/test_main.cpp:5:
In file included from /usr/local/include/gtest/gtest.h:65:
In file included from /usr/local/include/gtest/gtest-death-test.h:43:
In file included from /usr/local/include/gtest/internal/gtest-death-test-internal.h:47:
In file included from /usr/local/include/gtest/gtest-matchers.h:48:
In file included from /usr/local/include/gtest/gtest-printers.h:115:
/usr/local/include/gtest/internal/gtest-internal.h:636:54: error: too few template arguments for class template 'less'
  typedef ::std::map<std::string, CodeLocation, std::less<>> RegisteredTestsMap;
                                                     ^
/usr/include/c++/v1/__functional/operations.h:366:29: note: template is declared here
struct _LIBCPP_TEMPLATE_VIS less
                            ^
In file included from /usr/ports/misc/lightgbm/work/LightGBM-4.0.0/tests/cpp_tests/test_main.cpp:5:
In file included from /usr/local/include/gtest/gtest.h:65:
In file included from /usr/local/include/gtest/gtest-death-test.h:43:
In file included from /usr/local/include/gtest/internal/gtest-death-test-internal.h:47:
In file included from /usr/local/include/gtest/gtest-matchers.h:48:
In file included from /usr/local/include/gtest/gtest-printers.h:115:
/usr/local/include/gtest/internal/gtest-internal.h:613:22: error: member reference base type 'testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'int') is not a structure or union
    registered_tests_.insert(
    ~~~~~~~~~~~~~~~~~^~~~~~~
/usr/local/include/gtest/internal/gtest-internal.h:619:29: error: member reference base type 'const testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'const int') is not a structure or union
    return registered_tests_.count(test_name) > 0;
           ~~~~~~~~~~~~~~~~~^~~~~~
/usr/local/include/gtest/internal/gtest-internal.h:623:5: error: 'testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'int') is not a class, namespace, or enumeration
    RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
    ^
/usr/local/include/gtest/internal/gtest-internal.h:623:62: error: member reference base type 'const testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'const int') is not a structure or union
    RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
                                            ~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/gtest/internal/gtest-internal.h:624:41: error: member reference base type 'const testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'const int') is not a structure or union
    GTEST_CHECK_(it != registered_tests_.end());
                       ~~~~~~~~~~~~~~~~~^~~~
/usr/local/include/gtest/internal/gtest-port.h:1027:35: note: expanded from macro 'GTEST_CHECK_'
  if (::testing::internal::IsTrue(condition)) \
                                  ^~~~~~~~~
7 errors generated.

Environment info

LightGBM version or commit hash: 4.0.0
clang-15
pytest-7.3.1
FreeBSD 13.2

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions