blob: 1578df8e3fb7da660e6d769d2d51e1a768f708ac [file] [log] [blame]
Craig Tiller6ec5d6f2015-09-28 12:53:05 -07001#!/usr/bin/env bash
Jan Tattermusch7897ae92017-06-07 22:57:36 +02002# Copyright 2015 gRPC authors.
Jan Tattermusch083466f2015-06-03 13:17:40 -07003#
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 Tattermusch083466f2015-06-03 13:17:40 -07007#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02008# http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermusch083466f2015-06-03 13:17:40 -07009#
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 Tattermusch8fa8c042015-06-03 14:02:07 -070015#
Jan Tattermusch083466f2015-06-03 13:17:40 -070016# This script is invoked by Jenkins and triggers a test run based on
17# env variable settings.
Jan Tattermusch8fa8c042015-06-03 14:02:07 -070018#
Nicolas "Pixel" Noble7df72082015-07-11 02:16:45 +020019# Setting up rvm environment BEFORE we set -ex.
20[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
Jan Tattermusch8fa8c042015-06-03 14:02:07 -070021# To prevent cygwin bash complaining about empty lines ending with \r
22# we set the igncr option. The option doesn't exist on Linux, so we fallback
23# to just 'set -ex' there.
24# NOTE: No empty lines should appear in this file before igncr is set!
25set -ex -o igncr || set -ex
Jan Tattermusch083466f2015-06-03 13:17:40 -070026
27if [ "$platform" == "linux" ]
28then
Craig Tiller3ec6b952016-01-28 10:06:11 -080029 PLATFORM_SPECIFIC_ARGS="--use_docker --measure_cpu_costs"
Nicolas "Pixel" Noble4243ca82015-07-23 23:47:56 +020030elif [ "$platform" == "freebsd" ]
31then
Jan Tattermusch1961a802016-01-25 21:30:24 -080032 export MAKE=gmake
Jan Tattermusch083466f2015-06-03 13:17:40 -070033fi
Nicolas "Pixel" Noble52f6fc12015-10-08 23:25:06 +020034
Jan Tattermusch1961a802016-01-25 21:30:24 -080035unset platform # variable named 'platform' breaks the windows build
36
Craig Tiller3ec6b952016-01-28 10:06:11 -080037python tools/run_tests/run_tests.py \
38 $PLATFORM_SPECIFIC_ARGS \
39 -t \
40 -l $language \
41 -c $config \
42 -x report.xml \
43 -j 2 \
44 $@ || TESTS_FAILED="true"
Jan Tattermusch1961a802016-01-25 21:30:24 -080045
Nicolas "Pixel" Noble52f6fc12015-10-08 23:25:06 +020046if [ ! -e reports/index.html ]
47then
48 mkdir -p reports
49 echo 'No reports generated.' > reports/index.html
50fi
Craig Tillerb361b4e2016-01-06 11:44:17 -080051
52if [ "$TESTS_FAILED" != "" ]
53then
54 exit 1
55fi