RobertIndie opened a new pull request, #16776:
URL: https://github.com/apache/pulsar/pull/16776
<!--
### Contribution Checklist
- PR title format should be *[type][component] summary*. For details, see
*[Guideline - Pulsar PR Naming
Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*.
- Fill out the template below to describe the changes contributed by the
pull request. That will give reviewers the context they need to do the review.
- Each pull request should address only one issue, not mix up code from
multiple issues.
- Each commit in the pull request has a meaningful commit message
- Once all items of the checklist are addressed, remove the above text and
this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
### Motivation
As discussed with @BewareMyPower. Currently, compiling the C++ client does
not support using the latest main branch of
[gtest](https://github.com/google/googletest).
The following error will occur:
```
In file included from
/Users/aaronrobert/codebase/pulsar/pulsar-client-cpp/tests/AuthPluginTest.cc:20:
In file included from /usr/local/include/gtest/gtest.h:60:
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:46:
In file included from /usr/local/include/gtest/gtest-matchers.h:48:
In file included from /usr/local/include/gtest/gtest-printers.h:114:
/usr/local/include/gtest/internal/gtest-internal.h:635:54: error: too few
template arguments for class template 'less'
typedef ::std::map<std::string, CodeLocation, std::less<>>
RegisteredTestsMap;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/__functional_base:50:29:
note: template is declared here
struct _LIBCPP_TEMPLATE_VIS less : binary_function<_Tp, _Tp, bool>
^
In file included from
/Users/aaronrobert/codebase/pulsar/pulsar-client-cpp/tests/AuthPluginTest.cc:20:
In file included from /usr/local/include/gtest/gtest.h:60:
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:46:
In file included from /usr/local/include/gtest/gtest-matchers.h:48:
In file included from /usr/local/include/gtest/gtest-printers.h:114:
/usr/local/include/gtest/internal/gtest-internal.h:612: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:618: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:622: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:622: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:623: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:1005:35: note: expanded from
macro 'GTEST_CHECK_'
if (::testing::internal::IsTrue(condition)) \
^~~~~~~~~
6 errors generated.
make[2]: *** [tests/CMakeFiles/main.dir/AuthPluginTest.cc.o] Error 1
make[1]: *** [tests/CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2
```
We need to use the released gtest version like 1.12.1 to compile the c++
client tests.
### Modifications
* Use gtest 1.12.1 to compile the c++ client.
### Documentation
Check the box below or label this PR directly.
Need to update docs?
- [ ] `doc-required`
(Your PR needs to update docs and you will update later)
- [ ] `doc-not-needed`
(Please explain why)
- [x] `doc`
(Your PR contains doc changes)
- [ ] `doc-complete`
(Docs have been already added)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]