Есть ли способ использовать Google Test Tool на компиляторе G cc 4.5.2? - PullRequest
0 голосов
/ 21 января 2020

Я использую google test c ++ freamwork, чтобы протестировать мой проект, но столкнулся с некоторой проблемой для вашей справки, см. Ошибки компиляции следующим образом.

src/exclusions/Gtest/../../include/gtest/internal/gtest-port.h:972:37: error: ‘nullptr’ was not declared in this scope
src/exclusions/Gtest/../../include/gtest/internal/gtest-port.h:1316:22: error: expected ‘;’ before ‘override’
src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:307:37: error: ‘testing::internal::MatcherBase<T>::MatcherBase(const testing::internal::MatcherBase<T>&)’ declared with non-public access cannot be defaulted in the class body
/home/buildserver/rswork25Nov/Dev-UEM-1.2-POC/src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:308:48: error: ‘testing::internal::MatcherBase<T>& testing::internal::MatcherBase<T>::operator=(const testing::internal::MatcherBase<T>&)’ declared with non-public access cannot be defaulted in the class body
src/exclusions/Gtest/../../include/gtest/internal/gtest-param-util.h:521:74: error: there are no arguments to ‘InstantiationInfo’ that depend on a template parameter, so a declaration of ‘InstantiationInfo’ must be available
src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:305:61: error: cannot allocate an object of abstract type ‘testing::internal::MatcherInterfaceAdapter<std::basic_string<char> >’

1 Ответ

1 голос
/ 21 января 2020

Может быть, вы можете прибегнуть к старому тегу googletest?

Сравнить 1.8.1 требования:

Linux Requirements

These are the base requirements to build and use Google Test from a source package (as described below):

GNU-compatible Make or gmake
POSIX-standard shell
POSIX(-2) Regular Expressions (regex.h)
A C++98-standard-compliant compiler

с последним:

Build Requirements

These are the base requirements to build and use Google Test from a source package:

Bazel or CMake. NOTE: Bazel is the build system that googletest is using internally and tests against. CMake is community-supported.

a C++11-standard-compliant compiler

Я полагаю, вы должны сделать компромисс: совместимость с вашей цепочкой инструментов для googletest функций.

...