diff options
author | Krzysztof Kosiński <krzysio@google.com> | 2023-09-28 00:37:09 +0000 |
---|---|---|
committer | Krzysztof Kosiński <krzysio@google.com> | 2023-09-28 09:44:10 +0000 |
commit | a00801a508bed52885e961b08058af6af7206bf9 (patch) | |
tree | e568063ca5d9e9e557d71e24304156a62534b94a /ci/linux-presubmit.sh | |
parent | 817e9f6edc2fc8301b92403962478d2df0024924 (diff) | |
parent | e47544ad31cb3ceecd04cc13e8fe556f8df9fe0b (diff) | |
download | googletest-a00801a508bed52885e961b08058af6af7206bf9.tar.gz |
Upgrade googletest to most recent upstream version.
Changes needed to complete the upgrade:
- Bump GMock C++ version to C++14.
- Set gmock_tests to C++14 to work around an issue with
ExpectCallTest.NonMoveableType, which fails to compile
with the current AOSP compiler.
- Disable -Wthread-safety-negative for the Notification type
(breaks code that enables -Werror).
- Disable -Wfloat-equal in AppropriateResolution (ditto).
- Disable -Wuser-defined-warnings for the pointer printer
to avoid errors in mock methods from the std namespace
manipulation in android-base/logging.h.
- Temporarily add an inclusion of <iomanip> to
gtest/internal/custom/gtest-port.h. This header was previously
included by gtest/internal/gtest-internal.h and many tests
do not include it explicitly.
- Remove the newline added in AddTestPartResult so that the
golden output tests in gtest_isolated_tests do not break.
Bug: 271622675
Test: presubmit
Change-Id: Ic34a9add234dbbc5fc5162d0408c78844f2ae1e6
Diffstat (limited to 'ci/linux-presubmit.sh')
-rw-r--r-- | ci/linux-presubmit.sh | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/ci/linux-presubmit.sh b/ci/linux-presubmit.sh index d02130c3..a1caa272 100644 --- a/ci/linux-presubmit.sh +++ b/ci/linux-presubmit.sh @@ -31,15 +31,15 @@ set -euox pipefail -readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20201008" -readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20201015" +readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20230816" +readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20230120" if [[ -z ${GTEST_ROOT:-} ]]; then GTEST_ROOT="$(realpath $(dirname ${0})/..)" fi if [[ -z ${STD:-} ]]; then - STD="c++11 c++14 c++17 c++20" + STD="c++14 c++17 c++20" fi # Test the CMake build @@ -51,11 +51,11 @@ for cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do --workdir="/build" \ --rm \ --env="CC=${cc}" \ - --env="CXX_FLAGS=\"-Werror -Wdeprecated\"" \ + --env=CXXFLAGS="-Werror -Wdeprecated" \ ${LINUX_LATEST_CONTAINER} \ /bin/bash -c " cmake /src \ - -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_CXX_STANDARD=14 \ -Dgtest_build_samples=ON \ -Dgtest_build_tests=ON \ -Dgmock_build_tests=ON \ @@ -72,11 +72,16 @@ time docker run \ --workdir="/src" \ --rm \ --env="CC=/usr/local/bin/gcc" \ + --env="BAZEL_CXXOPTS=-std=c++14" \ ${LINUX_GCC_FLOOR_CONTAINER} \ /usr/local/bin/bazel test ... \ --copt="-Wall" \ --copt="-Werror" \ + --copt="-Wuninitialized" \ + --copt="-Wundef" \ --copt="-Wno-error=pragmas" \ + --distdir="/bazel-distdir" \ + --features=external_include_paths \ --keep_going \ --show_timestamps \ --test_output=errors @@ -94,7 +99,11 @@ for std in ${STD}; do /usr/local/bin/bazel test ... \ --copt="-Wall" \ --copt="-Werror" \ + --copt="-Wuninitialized" \ + --copt="-Wundef" \ --define="absl=${absl}" \ + --distdir="/bazel-distdir" \ + --features=external_include_paths \ --keep_going \ --show_timestamps \ --test_output=errors @@ -115,7 +124,11 @@ for std in ${STD}; do --copt="--gcc-toolchain=/usr/local" \ --copt="-Wall" \ --copt="-Werror" \ + --copt="-Wuninitialized" \ + --copt="-Wundef" \ --define="absl=${absl}" \ + --distdir="/bazel-distdir" \ + --features=external_include_paths \ --keep_going \ --linkopt="--gcc-toolchain=/usr/local" \ --show_timestamps \ |