blob: 790c04188169c292daaa2867c7ef78036d0b9b70 [file] [log] [blame]
Jan Tattermusch3b0d0922016-09-19 14:33:18 +02001#!/bin/bash
Jan Tattermusch7897ae92017-06-07 22:57:36 +02002# Copyright 2015 gRPC authors.
Jan Tattermusch3b0d0922016-09-19 14:33:18 +02003#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02004# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
Jan Tattermusch3b0d0922016-09-19 14:33:18 +02007#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02008# http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermusch3b0d0922016-09-19 14:33:18 +02009#
Jan Tattermusch7897ae92017-06-07 22:57:36 +020010# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Jan Tattermusch3b0d0922016-09-19 14:33:18 +020015#
16# Create a workspace in a subdirectory to allow running multiple builds in isolation.
17# WORKSPACE_NAME env variable needs to contain name of the workspace to create.
18# All cmdline args will be passed to run_tests.py script (executed in the
19# newly created workspace)
20set -ex
21
Mehrdad Afshari290bbd22017-12-15 13:38:59 -080022cd "$(dirname "$0")/../../.."
23export repo_root="$(pwd)"
Jan Tattermusch3b0d0922016-09-19 14:33:18 +020024
25rm -rf "${WORKSPACE_NAME}"
Jan Tattermusch42519452016-10-12 18:56:42 +020026git clone . "${WORKSPACE_NAME}"
27# clone gRPC submodules, use data from locally cloned submodules where possible
Mehrdad Afshari290bbd22017-12-15 13:38:59 -080028# shellcheck disable=SC2016,SC1004
Jan Tattermusch42519452016-10-12 18:56:42 +020029git submodule foreach 'cd "${repo_root}/${WORKSPACE_NAME}" \
30 && git submodule update --init --reference ${repo_root}/${name} ${name}'
Jan Tattermusch3b0d0922016-09-19 14:33:18 +020031
32echo "Running run_tests.py in workspace ${WORKSPACE_NAME}"
Mehrdad Afshari290bbd22017-12-15 13:38:59 -080033python "${WORKSPACE_NAME}/tools/run_tests/run_tests.py" "$@"