Skip to content

Commit

Permalink
[C++] Fix pulsar client cpp build fail in gcc-4.8.5 (#14053)
Browse files Browse the repository at this point in the history
* Fix pulsar client cpp build fail in gcc-4.8.5

* Enable test

* Speedup make speed

* Add a new line at the tail

Add a new line at the tail of a file

(cherry picked from commit caf5acf)
  • Loading branch information
Demogorgon314 authored and zymap committed Feb 10, 2022
1 parent 3d2e6ce commit 3fd035d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pulsar-client-cpp/docker-build-centos7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cd -

VOLUME_OPTION=${VOLUME_OPTION:-"-v $ROOT_DIR:/pulsar"}
COMMAND="cd /pulsar/pulsar-client-cpp && mkdir -p _builds && cd _builds &&
/opt/cmake/cmake-3.4.0-Linux-x86_64/bin/cmake .. -DBUILD_PYTHON_WRAPPER=OFF -DBUILD_TESTS=OFF && make"
/opt/cmake/cmake-3.4.0-Linux-x86_64/bin/cmake .. -DBUILD_PYTHON_WRAPPER=OFF -DBUILD_TESTS=ON && make -j8"

DOCKER_CMD="docker run -i ${VOLUME_OPTION} ${IMAGE}"

Expand Down
7 changes: 7 additions & 0 deletions pulsar-client-cpp/docker/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ RUN mkdir -p /opt/cmake
WORKDIR /opt/cmake
RUN curl -L -O https://cmake.org/files/v3.4/cmake-3.4.0-Linux-x86_64.tar.gz \
&& tar zxf cmake-3.4.0-Linux-x86_64.tar.gz

# googletest
RUN curl -O -L https://github.com/google/googletest/archive/refs/tags/release-1.10.0.tar.gz \
&& tar zxf release-1.10.0.tar.gz \
&& cd googletest-release-1.10.0 \
&& mkdir build && cd build \
&& /opt/cmake/cmake-3.4.0-Linux-x86_64/bin/cmake .. && make install
2 changes: 1 addition & 1 deletion pulsar-client-cpp/tests/ConsumerTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ TEST(ConsumerTest, testGetTopicNameFromReceivedMessage) {

// 2. MultiTopicsConsumerImpl
Consumer consumer2;
ASSERT_EQ(ResultOk, client.subscribe({topic1, topic2}, "sub-2", consumer2));
ASSERT_EQ(ResultOk, client.subscribe(std::vector<std::string>{topic1, topic2}, "sub-2", consumer2));

sendMessage(topic1, true);
validateTopicName(consumer1, topic1);
Expand Down

0 comments on commit 3fd035d

Please sign in to comment.