Craig Tiller | 6ec5d6f | 2015-09-28 12:53:05 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Jan Tattermusch | 083466f | 2015-06-03 13:17:40 -0700 | [diff] [blame] | 2 | # 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 Tattermusch | 8fa8c04 | 2015-06-03 14:02:07 -0700 | [diff] [blame] | 30 | # |
Jan Tattermusch | 083466f | 2015-06-03 13:17:40 -0700 | [diff] [blame] | 31 | # This script is invoked by Jenkins and triggers a test run based on |
| 32 | # env variable settings. |
Jan Tattermusch | 8fa8c04 | 2015-06-03 14:02:07 -0700 | [diff] [blame] | 33 | # |
Nicolas "Pixel" Noble | 7df7208 | 2015-07-11 02:16:45 +0200 | [diff] [blame] | 34 | # Setting up rvm environment BEFORE we set -ex. |
| 35 | [[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh |
Jan Tattermusch | 8fa8c04 | 2015-06-03 14:02:07 -0700 | [diff] [blame] | 36 | # 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! |
| 40 | set -ex -o igncr || set -ex |
Jan Tattermusch | 083466f | 2015-06-03 13:17:40 -0700 | [diff] [blame] | 41 | |
Nicolas "Pixel" Noble | b8c1524 | 2015-07-11 02:38:35 +0200 | [diff] [blame] | 42 | # Grabbing the machine's architecture |
| 43 | arch=`uname -m` |
| 44 | |
| 45 | case $platform in |
| 46 | i386) |
| 47 | arch="i386" |
| 48 | platform="linux" |
Nicolas "Pixel" Noble | 482d761 | 2015-07-16 23:43:30 +0200 | [diff] [blame] | 49 | docker_suffix=_32bits |
Nicolas "Pixel" Noble | b8c1524 | 2015-07-11 02:38:35 +0200 | [diff] [blame] | 50 | ;; |
| 51 | esac |
| 52 | |
Jan Tattermusch | 083466f | 2015-06-03 13:17:40 -0700 | [diff] [blame] | 53 | if [ "$platform" == "linux" ] |
| 54 | then |
| 55 | echo "building $language on Linux" |
| 56 | |
Craig Tiller | 6ec5d6f | 2015-09-28 12:53:05 -0700 | [diff] [blame] | 57 | ./tools/run_tests/run_tests.py --use_docker -t -l $language -c $config -x report.xml $@ || true |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 58 | |
Jan Tattermusch | 083466f | 2015-06-03 13:17:40 -0700 | [diff] [blame] | 59 | elif [ "$platform" == "windows" ] |
| 60 | then |
| 61 | echo "building $language on Windows" |
| 62 | |
Jan Tattermusch | a959e64 | 2015-06-03 16:32:13 -0700 | [diff] [blame] | 63 | # Prevent msbuild from picking up "platform" env variable, which would break the build |
| 64 | unset platform |
| 65 | |
Craig Tiller | 6ec5d6f | 2015-09-28 12:53:05 -0700 | [diff] [blame] | 66 | python tools/run_tests/run_tests.py -t -l $language -x report.xml $@ || true |
Nicolas "Pixel" Noble | 4243ca8 | 2015-07-23 23:47:56 +0200 | [diff] [blame] | 67 | |
Nicolas "Pixel" Noble | 4853246 | 2015-07-09 03:34:22 +0200 | [diff] [blame] | 68 | elif [ "$platform" == "macos" ] |
| 69 | then |
| 70 | echo "building $language on MacOS" |
| 71 | |
Craig Tiller | 6ec5d6f | 2015-09-28 12:53:05 -0700 | [diff] [blame] | 72 | ./tools/run_tests/run_tests.py -t -l $language -c $config -x report.xml $@ || true |
Nicolas "Pixel" Noble | 4243ca8 | 2015-07-23 23:47:56 +0200 | [diff] [blame] | 73 | |
| 74 | elif [ "$platform" == "freebsd" ] |
| 75 | then |
| 76 | echo "building $language on FreeBSD" |
| 77 | |
Craig Tiller | 6ec5d6f | 2015-09-28 12:53:05 -0700 | [diff] [blame] | 78 | MAKE=gmake ./tools/run_tests/run_tests.py -t -l $language -c $config -x report.xml $@ || true |
Jan Tattermusch | 8266c67 | 2015-09-17 09:18:03 -0700 | [diff] [blame] | 79 | |
| 80 | elif [ "$platform" == "interop" ] |
| 81 | then |
| 82 | echo "building interop tests for language $language" |
| 83 | |
Jan Tattermusch | bd7682f | 2015-09-28 15:07:48 -0700 | [diff] [blame] | 84 | ./tools/run_tests/run_interop_tests.py --use_docker -t -l $language --cloud_to_prod --server all || true |
Jan Tattermusch | 083466f | 2015-06-03 13:17:40 -0700 | [diff] [blame] | 85 | else |
| 86 | echo "Unknown platform $platform" |
| 87 | exit 1 |
| 88 | fi |