blob: 67cfc2bb0a4a839d93a8c53feb1cfc234e9ab724 [file] [log] [blame]
Craig Tiller6ec5d6f2015-09-28 12:53:05 -07001#!/usr/bin/env bash
Jan Tattermusch083466f2015-06-03 13:17:40 -07002# Copyright 2015, Google Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met:
8#
9# * Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# * Redistributions in binary form must reproduce the above
12# copyright notice, this list of conditions and the following disclaimer
13# in the documentation and/or other materials provided with the
14# distribution.
15# * Neither the name of Google Inc. nor the names of its
16# contributors may be used to endorse or promote products derived from
17# this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jan Tattermusch8fa8c042015-06-03 14:02:07 -070030#
Jan Tattermusch083466f2015-06-03 13:17:40 -070031# This script is invoked by Jenkins and triggers a test run based on
32# env variable settings.
Jan Tattermusch8fa8c042015-06-03 14:02:07 -070033#
Nicolas "Pixel" Noble7df72082015-07-11 02:16:45 +020034# Setting up rvm environment BEFORE we set -ex.
35[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
Jan Tattermusch8fa8c042015-06-03 14:02:07 -070036# To prevent cygwin bash complaining about empty lines ending with \r
37# we set the igncr option. The option doesn't exist on Linux, so we fallback
38# to just 'set -ex' there.
39# NOTE: No empty lines should appear in this file before igncr is set!
40set -ex -o igncr || set -ex
Jan Tattermusch083466f2015-06-03 13:17:40 -070041
Nicolas "Pixel" Nobleb8c15242015-07-11 02:38:35 +020042# Grabbing the machine's architecture
43arch=`uname -m`
44
45case $platform in
46 i386)
47 arch="i386"
48 platform="linux"
Nicolas "Pixel" Noble482d7612015-07-16 23:43:30 +020049 docker_suffix=_32bits
Nicolas "Pixel" Nobleb8c15242015-07-11 02:38:35 +020050 ;;
51esac
52
Jan Tattermusch083466f2015-06-03 13:17:40 -070053if [ "$platform" == "linux" ]
54then
55 echo "building $language on Linux"
56
Craig Tiller6ec5d6f2015-09-28 12:53:05 -070057 ./tools/run_tests/run_tests.py --use_docker -t -l $language -c $config -x report.xml $@ || true
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020058
Jan Tattermusch083466f2015-06-03 13:17:40 -070059elif [ "$platform" == "windows" ]
60then
61 echo "building $language on Windows"
62
Jan Tattermuscha959e642015-06-03 16:32:13 -070063 # Prevent msbuild from picking up "platform" env variable, which would break the build
64 unset platform
65
Craig Tiller6ec5d6f2015-09-28 12:53:05 -070066 python tools/run_tests/run_tests.py -t -l $language -x report.xml $@ || true
Nicolas "Pixel" Noble4243ca82015-07-23 23:47:56 +020067
Nicolas "Pixel" Noble48532462015-07-09 03:34:22 +020068elif [ "$platform" == "macos" ]
69then
70 echo "building $language on MacOS"
71
Craig Tiller6ec5d6f2015-09-28 12:53:05 -070072 ./tools/run_tests/run_tests.py -t -l $language -c $config -x report.xml $@ || true
Nicolas "Pixel" Noble4243ca82015-07-23 23:47:56 +020073
74elif [ "$platform" == "freebsd" ]
75then
76 echo "building $language on FreeBSD"
77
Craig Tiller6ec5d6f2015-09-28 12:53:05 -070078 MAKE=gmake ./tools/run_tests/run_tests.py -t -l $language -c $config -x report.xml $@ || true
Jan Tattermusch8266c672015-09-17 09:18:03 -070079
80elif [ "$platform" == "interop" ]
81then
82 echo "building interop tests for language $language"
83
Jan Tattermuschbd7682f2015-09-28 15:07:48 -070084 ./tools/run_tests/run_interop_tests.py --use_docker -t -l $language --cloud_to_prod --server all || true
Jan Tattermusch083466f2015-06-03 13:17:40 -070085else
86 echo "Unknown platform $platform"
87 exit 1
88fi