Googletest export
Generalize root directory in CI scripts PiperOrigin-RevId: 367628939
This commit is contained in:
parent
ad462b70c9
commit
965f8ecbfd
@ -34,7 +34,9 @@ set -euox pipefail
|
|||||||
readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20201008"
|
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_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
|
if [[ -z ${STD:-} ]]; then
|
||||||
STD="c++11 c++14 c++17 c++20"
|
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 cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do
|
||||||
for cmake_off_on in OFF ON; do
|
for cmake_off_on in OFF ON; do
|
||||||
time docker run \
|
time docker run \
|
||||||
--volume="${SRC}:/src:ro" \
|
--volume="${GTEST_ROOT}:/src:ro" \
|
||||||
--tmpfs="/build:exec" \
|
--tmpfs="/build:exec" \
|
||||||
--workdir="/build" \
|
--workdir="/build" \
|
||||||
--rm \
|
--rm \
|
||||||
@ -66,7 +68,7 @@ done
|
|||||||
|
|
||||||
# Do one test with an older version of GCC
|
# Do one test with an older version of GCC
|
||||||
time docker run \
|
time docker run \
|
||||||
--volume="${SRC}:/src:ro" \
|
--volume="${GTEST_ROOT}:/src:ro" \
|
||||||
--workdir="/src" \
|
--workdir="/src" \
|
||||||
--rm \
|
--rm \
|
||||||
--env="CC=/usr/local/bin/gcc" \
|
--env="CC=/usr/local/bin/gcc" \
|
||||||
@ -83,7 +85,7 @@ time docker run \
|
|||||||
for std in ${STD}; do
|
for std in ${STD}; do
|
||||||
for absl in 0 1; do
|
for absl in 0 1; do
|
||||||
time docker run \
|
time docker run \
|
||||||
--volume="${SRC}:/src:ro" \
|
--volume="${GTEST_ROOT}:/src:ro" \
|
||||||
--workdir="/src" \
|
--workdir="/src" \
|
||||||
--rm \
|
--rm \
|
||||||
--env="CC=/usr/local/bin/gcc" \
|
--env="CC=/usr/local/bin/gcc" \
|
||||||
@ -103,7 +105,7 @@ done
|
|||||||
for std in ${STD}; do
|
for std in ${STD}; do
|
||||||
for absl in 0 1; do
|
for absl in 0 1; do
|
||||||
time docker run \
|
time docker run \
|
||||||
--volume="${SRC}:/src:ro" \
|
--volume="${GTEST_ROOT}:/src:ro" \
|
||||||
--workdir="/src" \
|
--workdir="/src" \
|
||||||
--rm \
|
--rm \
|
||||||
--env="CC=/opt/llvm/clang/bin/clang" \
|
--env="CC=/opt/llvm/clang/bin/clang" \
|
||||||
|
@ -31,13 +31,15 @@
|
|||||||
|
|
||||||
set -euox pipefail
|
set -euox pipefail
|
||||||
|
|
||||||
SRC=$(realpath git/googletest)
|
if [[ -z ${GTEST_ROOT:-} ]]; then
|
||||||
|
GTEST_ROOT="$(realpath $(dirname ${0})/..)"
|
||||||
|
fi
|
||||||
|
|
||||||
# Test the CMake build
|
# Test the CMake build
|
||||||
for cmake_off_on in OFF ON; do
|
for cmake_off_on in OFF ON; do
|
||||||
BUILD_DIR=$(mktemp -d build_dir.XXXXXXXX)
|
BUILD_DIR=$(mktemp -d build_dir.XXXXXXXX)
|
||||||
cd ${BUILD_DIR}
|
cd ${BUILD_DIR}
|
||||||
time cmake ${SRC} \
|
time cmake ${GTEST_ROOT} \
|
||||||
-DCMAKE_CXX_STANDARD=11 \
|
-DCMAKE_CXX_STANDARD=11 \
|
||||||
-Dgtest_build_samples=ON \
|
-Dgtest_build_samples=ON \
|
||||||
-Dgtest_build_tests=ON \
|
-Dgtest_build_tests=ON \
|
||||||
@ -59,7 +61,7 @@ else
|
|||||||
BAZEL_BIN="bazel"
|
BAZEL_BIN="bazel"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ${SRC}
|
cd ${GTEST_ROOT}
|
||||||
for absl in 0 1; do
|
for absl in 0 1; do
|
||||||
${BAZEL_BIN} test ... \
|
${BAZEL_BIN} test ... \
|
||||||
--copt="-Wall" \
|
--copt="-Wall" \
|
||||||
|
Loading…
Reference in New Issue
Block a user