From 376f7384c323295ec6d050547a5feb006bacc247 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Thu, 2 Nov 2017 00:21:53 -0700 Subject: [PATCH] Run the Swift runtime unit tests during the Travis run. These are the unit tests that are written in Swift, not the more in-depth runtime-testsuite tests (we were always running those). I don't know why JAVA_HOME isn't set during run-tests-swift.sh, but it isn't. Set it, since runtime/Swift/boot.py expects it as part of the parser generation. --- .travis/run-tests-swift.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis/run-tests-swift.sh b/.travis/run-tests-swift.sh index 8c63070aa..b78a1bb42 100755 --- a/.travis/run-tests-swift.sh +++ b/.travis/run-tests-swift.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -euo pipefail + # linux specific setup, those setup have to be # here since environment variables doesn't pass # across scripts @@ -13,10 +15,20 @@ if [ $TRAVIS_OS_NAME == "linux" ]; then curl https://swift.org/builds/$SWIFT_VERSION-release/ubuntu1404/$SWIFT_VERSION-RELEASE/$SWIFT_VERSION-RELEASE-ubuntu14.04.tar.gz -s | tar xz -C swift &> /dev/null fi +if [ -z "${JAVA_HOME-}" ] +then + export JAVA_HOME="$(dirname $(java -XshowSettings:properties -version 2>&1 | + grep 'java\.home' | awk '{ print $3 }'))" +fi + # check swift swift --version swift build --version +pushd ../runtime/Swift +./boot.py --test +popd + if [ $GROUP == "LEXER" ]; then mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=swift.* test elif [ $GROUP == "PARSER" ]; then