blob: 31ffbdc348ef847f5b05d5272b077736861a7a8d [file] [log] [blame]
#!/bin/bash
# bail on error
set -e
# build autogenerated code in test to keep the analyzer happy
pub run build_runner build test
if [ "$TRAVIS_DART_VERSION" = "stable" ]; then
echo "Analyzing with `dartanalyzer --version`"
dartanalyzer="dartanalyzer --strong --fatal-warnings lib/*.dart test/*.dart"
$dartanalyzer
fi
pub deps
# run the tests
pub run build_runner test
# Only run with the stable version of dart.
if [ "$TRAVIS_DART_VERSION" = "stable" ]; then
pub global activate dart_style
dirty_code=$(pub global run dart_style:format --dry-run lib/ test/ example/)
if [[ -n "$dirty_code" ]]; then
echo Unformatted files:
echo "$dirty_code" | sed 's/^/ /'
exit 1
else
echo All Dart source files are formatted.
fi
# Install dart_coveralls; gather and send coverage data.
if [ "$COVERALLS_TOKEN" ]; then
pub global activate dart_coveralls
pub global run dart_coveralls report \
--retry 2 \
--exclude-test-files \
test/mustache_all.dart
fi
fi
if [ "$TRAVIS_DART_VERSION" = "1.23.0" ]; then
# make sure that dart2js works with dart v1
pub run test -p chrome,firefox
fi