Skip to content

Commit

Permalink
[thirdparty] update googletest up to 1.12.1 version
Browse files Browse the repository at this point in the history
Along with other fixes and updates, googletest v1.12.1 includes the fix
that allows for building the library with CLANG 13 and newer [1].

[1] google/googletest#3427

Change-Id: Ic1a398cbb93a6edb918e84e05927feb4b067058c
Reviewed-on: http://gerrit.cloudera.org:8080/18922
Reviewed-by: Attila Bukor <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
  • Loading branch information
alexeyserbin authored and zhangyifan27 committed Dec 28, 2022
1 parent f2c2bb5 commit f4a0040
Show file tree
Hide file tree
Showing 11 changed files with 343 additions and 21 deletions.
31 changes: 31 additions & 0 deletions build-support/iwyu/mappings/gmock.imp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
[
{ include: [ "<gmock/gmock-actions.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/gmock-cardinalities.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/gmock-function-mocker.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/gmock-matchers.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/gmock-more-actions.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/gmock-more-matchers.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/gmock-nice-strict.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/gmock-spec-builders.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/internal/custom/gmock-generated-actions.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/internal/custom/gmock-matchers.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/internal/custom/gmock-port.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/internal/gmock-internal-utils.h>", private, "<gmock/gmock.h>", public ] },
{ include: [ "<gmock/internal/gmock-port.h>", private, "<gmock/gmock.h>", public ] }
]
14 changes: 11 additions & 3 deletions build-support/iwyu/mappings/gtest.imp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@
# specific language governing permissions and limitations
# under the License.
[
{ include: [ "<gtest/internal/gtest-internal.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/internal/gtest-string.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest-assertion-result.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest-death-test.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest-matchers.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest-message.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest-param-test.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest-printers.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest-test-part.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest-typed-test.h>", private, "<gtest/gtest.h>", public ] }
{ include: [ "<gtest/gtest-typed-test.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/gtest_pred_impl.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/internal/gtest-death-test-internal.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/internal/gtest-filepath.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/internal/gtest-internal.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/internal/gtest-param-util.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/internal/gtest-port.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/internal/gtest-string.h>", private, "<gtest/gtest.h>", public ] },
{ include: [ "<gtest/internal/gtest-type-util.h>", private, "<gtest/gtest.h>", public ] }
]
2 changes: 1 addition & 1 deletion src/kudu/client/client-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <glog/stl_logging.h>
#include <gmock/gmock-matchers.h>
#include <gmock/gmock.h>
#include <google/protobuf/util/message_differencer.h>
#include <gtest/gtest.h>

Expand Down
2 changes: 1 addition & 1 deletion src/kudu/codegen/codegen-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <gflags/gflags_declare.h>
#include <glog/logging.h>
#include <glog/stl_logging.h> // IWYU pragma: keep
#include <gmock/gmock-matchers.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "kudu/codegen/code_generator.h"
Expand Down
2 changes: 1 addition & 1 deletion src/kudu/tools/kudu-tool-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <gflags/gflags_declare.h>
#include <glog/logging.h>
#include <glog/stl_logging.h>
#include <gmock/gmock-matchers.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "kudu/cfile/cfile-test-base.h"
Expand Down
3 changes: 1 addition & 2 deletions src/kudu/util/logging-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
#include <vector>

#include <glog/logging.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "kudu/gutil/strings/substitute.h"
Expand Down
8 changes: 8 additions & 0 deletions thirdparty/build-definitions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,17 @@ build_gmock_gtest() {
# Install gmock/gtest libraries and headers manually instead of using make
# install. Make install results in libraries with a malformed lib name on
# macOS.
if [ -n "$OS_LINUX" ]; then
local ver_suffix=${DYLIB_SUFFIX}.${GMOCK_VERSION}
else
# on macOS the naming of versioned libraries differ from what it's on Linux
local ver_suffix=${GMOCK_VERSION}.${DYLIB_SUFFIX}
fi
echo Installing gmock and gtest...
cp -a $GMOCK_SHARED_BDIR/lib/libgmock.$ver_suffix $PREFIX/lib/
cp -a $GMOCK_SHARED_BDIR/lib/libgmock.$DYLIB_SUFFIX $PREFIX/lib/
cp -a $GMOCK_STATIC_BDIR/lib/libgmock.a $PREFIX/lib/
cp -a $GMOCK_SHARED_BDIR/lib/libgtest.$ver_suffix $PREFIX/lib/
cp -a $GMOCK_SHARED_BDIR/lib/libgtest.$DYLIB_SUFFIX $PREFIX/lib/
cp -a $GMOCK_STATIC_BDIR/lib/libgtest.a $PREFIX/lib/
rsync -av $GMOCK_SOURCE/googlemock/include/ $PREFIX/include/
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/download-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fetch_and_patch \
googletest-release-${GMOCK_VERSION}.tar.gz \
$GMOCK_SOURCE \
$GMOCK_PATCHLEVEL \
"patch -p1 < $TP_DIR/patches/gmock-remove-unused-gunit-iwyu-pragma.patch"
"patch -p0 < $TP_DIR/patches/gmock-update-iwyu-pragma.patch"

GFLAGS_PATCHLEVEL=0
fetch_and_patch \
Expand Down
11 changes: 0 additions & 11 deletions thirdparty/patches/gmock-remove-unused-gunit-iwyu-pragma.patch

This file was deleted.

Loading

0 comments on commit f4a0040

Please sign in to comment.