blob: 97b8e96f9748483fb8e57a69d303970e0b820a16 [file] [log] [blame]
#!/bin/bash
# Fast fail the script on failures.
set -e
if [[ -z "$TRAVIS_BRANCH" ]]
then
TRAVIS_BRANCH="$(git branch)"
fi
# Go to the respective package directory
cd $PACKAGE
# Check if we should resolve pub dependencies, or use what was fetched from
# depot tools.
if [[ -z "$(echo $TRAVIS_BRANCH | grep 'SDK_AT_HEAD')" ]]
then
echo Using pub for the SDK dependencies.
echo
echo To test against the SDK at master, include SDK_AT_HEAD in your branch
echo name. Otherwise, we will test with pub.
pub get
else
echo Using depot_tools for the SDK dependencies.
echo
echo Because your branch name includes SDK_AT_HEAD, this will test against
echo the latest SDK source instead of using pub.
fi
# Analyze the test first
dartanalyzer lib test
# Run the actual tests
#dart --no-preview-dart-2 --checked test/test_all.dart # in dart 1 mode
dart --enable-asserts test/test_all.dart # and dart 2 mode