2016-11-21 11:50:54 +08:00
#!/bin/bash
2017-11-02 15:21:53 +08:00
set -euo pipefail
2017-05-14 08:00:27 +08:00
# linux specific setup, those setup have to be
# here since environment variables doesn't pass
# across scripts
if [ $TRAVIS_OS_NAME = = "linux" ] ; then
2019-03-29 06:24:27 +08:00
export SWIFT_VERSION = swift-5.0.1
2018-11-08 05:11:06 +08:00
export SWIFT_HOME = $( pwd ) /swift/$SWIFT_VERSION -RELEASE-ubuntu16.04/usr/bin/
2017-05-14 08:00:27 +08:00
export PATH = $SWIFT_HOME :$PATH
# download swift
mkdir swift
2018-11-08 05:11:06 +08:00
curl https://swift.org/builds/$SWIFT_VERSION -release/ubuntu1604/$SWIFT_VERSION -RELEASE/$SWIFT_VERSION -RELEASE-ubuntu16.04.tar.gz -s | tar xz -C swift & > /dev/null
2017-05-14 08:00:27 +08:00
fi
2017-11-02 15:21:53 +08:00
if [ -z " ${ JAVA_HOME - } " ]
then
2018-11-08 05:11:06 +08:00
export JAVA_HOME = " $( java -XshowSettings:properties -version 2>& 1 |
grep 'java\.home' | awk '{ print $3 }' ) "
echo " export JAVA_HOME= $JAVA_HOME "
2017-11-02 15:21:53 +08:00
fi
2017-05-14 08:00:27 +08:00
# check swift
swift --version
swift build --version
2017-11-02 15:21:53 +08:00
pushd ../runtime/Swift
./boot.py --test
popd
2017-06-27 01:47:01 +08:00
if [ $GROUP = = "LEXER" ] ; then
mvn -q -Dgroups= "org.antlr.v4.test.runtime.category.LexerTests" -Dtest= swift.* test
elif [ $GROUP = = "PARSER" ] ; then
mvn -q -Dgroups= "org.antlr.v4.test.runtime.category.ParserTests" -Dtest= swift.* test
elif [ $GROUP = = "RECURSION" ] ; then
2017-06-27 07:43:59 +08:00
mvn -q -Dgroups= "org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest= swift.* test
2017-06-27 01:47:01 +08:00
else
2017-06-28 20:40:16 +08:00
mvn -q -Dtest= swift.* test
2017-06-27 00:50:49 +08:00
fi