blob: b6748225091baf11bbc36b0aba9d922bd984a490 [file] [log] [blame]
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# Fast fail the script on failures.
set -e
# Run pub get to fetch packages.
dart pub get
# Prepare to run unit tests (but do not actually run tests).
dart pub run grinder buildbot
# Ensure that we've uploaded the compilation artifacts to google storage.
dart pub run grinder validate-storage-artifacts
# Enforce dart formatting on lib, test and tool directories.
echo -n "Files that need dart format: "
dart format --set-exit-if-changed lib test tool
echo "All clean"
# Gather coverage and upload to Coveralls.
if [ "$REPO_TOKEN" ] && [ "$TRAVIS_DART_VERSION" = "dev" ]; then
echo "Collecting coverage on port $OBS_PORT..."
# Start tests in one VM.
dart \
--enable-vm-service=$OBS_PORT \
--pause-isolates-on-exit \
test/all.dart &
# Run the coverage collector to generate the JSON coverage report.
pub run coverage:collect_coverage \
--port=$OBS_PORT \
--out=coverage.json \
--wait-paused \
echo "Generating LCOV report..."
pub run coverage:format_coverage \
--lcov \
--in=coverage.json \ \
--packages=.packages \
coveralls-lcov --repo-token="${REPO_TOKEN}"
dart test/all.dart