Imported Upstream version 3.8.0
[platform/upstream/protobuf.git] / kokoro / linux / cpp_distcheck / build.sh
1 #!/bin/bash
2 #
3 # Build file to set up and run tests
4
5 set -ex  # exit immediately on error
6
7 # Change to repo root
8 cd $(dirname $0)/../../..
9
10 ./tests.sh cpp_distcheck
11
12 # Run tests under release docker image.
13 DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ")
14 docker pull $DOCKER_IMAGE_NAME
15
16 docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \
17   bash -l /var/local/protobuf/tests.sh cpp || FAILED="true"
18
19 if [ "$FAILED" = "true" ]; then
20   exit 1
21 fi