2017-06-01 18:46:43 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Build file to set up and run tests
|
|
|
|
|
2019-03-04 18:18:18 +00:00
|
|
|
set -ex # exit immediately on error
|
2019-01-24 23:28:57 +00:00
|
|
|
|
2017-06-01 18:46:43 +00:00
|
|
|
# Change to repo root
|
|
|
|
cd $(dirname $0)/../../..
|
|
|
|
|
|
|
|
./tests.sh cpp_distcheck
|
2018-07-13 23:55:32 +00:00
|
|
|
|
|
|
|
# Run tests under release docker image.
|
|
|
|
DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ")
|
2020-02-11 19:17:35 +00:00
|
|
|
until docker pull $DOCKER_IMAGE_NAME; do sleep 10; done
|
2018-07-13 23:55:32 +00:00
|
|
|
|
|
|
|
docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \
|
|
|
|
bash -l /var/local/protobuf/tests.sh cpp || FAILED="true"
|
|
|
|
|
2021-02-11 00:29:44 +00:00
|
|
|
# This directory is owned by root. We need to delete it, because otherwise
|
|
|
|
# Kokoro will attempt to rsync it and fail with a permission error.
|
|
|
|
rm -rf src/core
|
|
|
|
|
2018-07-13 23:55:32 +00:00
|
|
|
if [ "$FAILED" = "true" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|