diff --git a/.travis.yml b/.travis.yml index f28c1d1c5..b318abfa1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,23 @@ env: - TEST_SUITE=ant - TEST_SUITE=unit - TEST_SUITE=regression + - TEST_SUITE=bazel + +# Prerequisites for Bazel +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - curl + - pkg-config + - zip + - g++ + - zlib1g-dev + - unzip + - python + +sudo: $TEST_SUITE = bazel # Empty the previously built artifacts # They cannot be deleted in the before_cache phase, diff --git a/jflex/examples/WORKSPACE b/jflex/examples/WORKSPACE new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/jflex/examples/WORKSPACE @@ -0,0 +1 @@ + diff --git a/scripts/bazel.sh b/scripts/bazel.sh new file mode 100755 index 000000000..f233e464f --- /dev/null +++ b/scripts/bazel.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Run bazel on examples + +CWD="$PWD" +BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"/.. +# Provides the logi function +source "$BASEDIR"/scripts/logger.sh +# fail on error +set -e + +logi "Install Bazel" +logi "=============" +curl -L https://github.com/bazelbuild/bazel/releases/download/0.16.1/bazel_0.16.1-linux-x86_64.deb -o tools/bazel-0.16.1.deb +sudo install tools/bazel-0.16.1.deb + +logi "Run Bazel tests on examples" +logi "===========================" +cd jflex/examples +bazel test /.. + +cd "$CWD" diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 8f012ac51..2c7536b87 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -33,6 +33,9 @@ if [[ -z "$TEST_SUITE" || "$TEST_SUITE" == "ant" ]]; then "$BASEDIR"/scripts/ant-build.sh "$BASEDIR"/scripts/test-examples.sh fi +if [[ -z "$TEST_SUITE" || "$TEST_SUITE" == "bazel" ]]; then + "$BASEDIR"/scripts/bazel.sh +fi logi "Success" cd "$CWD"