Googletest export

Generalize root directory in CI scripts

PiperOrigin-RevId: 367628939
This commit is contained in:
Abseil Team 2021-04-09 07:22:42 -07:00 committed by Dino Radaković
parent ad462b70c9
commit 965f8ecbfd
2 changed files with 12 additions and 8 deletions

View File

@ -34,7 +34,9 @@ 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"
SRC=$(realpath git/googletest)
if [[ -z ${GTEST_ROOT:-} ]]; then
GTEST_ROOT="$(realpath $(dirname ${0})/..)"
fi
if [[ -z ${STD:-} ]]; then
STD="c++11 c++14 c++17 c++20"
@ -44,7 +46,7 @@ fi
for cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do
for cmake_off_on in OFF ON; do
time docker run \
--volume="${SRC}:/src:ro" \
--volume="${GTEST_ROOT}:/src:ro" \
--tmpfs="/build:exec" \
--workdir="/build" \
--rm \
@ -66,7 +68,7 @@ done
# Do one test with an older version of GCC
time docker run \
--volume="${SRC}:/src:ro" \
--volume="${GTEST_ROOT}:/src:ro" \
--workdir="/src" \
--rm \
--env="CC=/usr/local/bin/gcc" \
@ -83,7 +85,7 @@ time docker run \
for std in ${STD}; do
for absl in 0 1; do
time docker run \
--volume="${SRC}:/src:ro" \
--volume="${GTEST_ROOT}:/src:ro" \
--workdir="/src" \
--rm \
--env="CC=/usr/local/bin/gcc" \
@ -103,7 +105,7 @@ done
for std in ${STD}; do
for absl in 0 1; do
time docker run \
--volume="${SRC}:/src:ro" \
--volume="${GTEST_ROOT}:/src:ro" \
--workdir="/src" \
--rm \
--env="CC=/opt/llvm/clang/bin/clang" \

View File

@ -31,13 +31,15 @@
set -euox pipefail
SRC=$(realpath git/googletest)
if [[ -z ${GTEST_ROOT:-} ]]; then
GTEST_ROOT="$(realpath $(dirname ${0})/..)"
fi
# Test the CMake build
for cmake_off_on in OFF ON; do
BUILD_DIR=$(mktemp -d build_dir.XXXXXXXX)
cd ${BUILD_DIR}
time cmake ${SRC} \
time cmake ${GTEST_ROOT} \
-DCMAKE_CXX_STANDARD=11 \
-Dgtest_build_samples=ON \
-Dgtest_build_tests=ON \
@ -59,7 +61,7 @@ else
BAZEL_BIN="bazel"
fi
cd ${SRC}
cd ${GTEST_ROOT}
for absl in 0 1; do
${BAZEL_BIN} test ... \
--copt="-Wall" \