blob: 578dedf2815c0aa4748fb67baa97b5d0b7059efe [file] [log] [blame]
Devon Carew26ceabe2014-12-11 11:44:53 -08001#!/bin/bash
2
3# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
4# for details. All rights reserved. Use of this source code is governed by a
5# BSD-style license that can be found in the LICENSE file.
6
7# Fast fail the script on failures.
8set -e
9
10# Get the Dart SDK.
11DART_DIST=dartsdk-linux-x64-release.zip
12curl http://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/$DART_DIST > $DART_DIST
13unzip $DART_DIST > /dev/null
14rm $DART_DIST
15export DART_SDK="$PWD/dart-sdk"
Devon Carew03d05202014-12-17 14:45:26 -080016export PATH="$DART_SDK/bin:$PATH"
Devon Carew26ceabe2014-12-11 11:44:53 -080017
18# Display installed versions.
19dart --version
20
21# Get our packages.
22pub get
23
24# Verify that the libraries are error free.
25dartanalyzer --fatal-warnings \
26 lib/usage.dart \
27 lib/usage_html.dart \
28 lib/usage_io.dart \
29 test/all.dart
30
31# Run the tests.
32dart test/all.dart
Devon Carew55ee3032014-12-16 15:47:11 -080033
Devon Carewb1fa88f2014-12-21 08:48:52 -080034# Measure the size of the compiled JS, for the dart:html version of the library.
35dart tool/grind.dart build
36
Devon Carew55ee3032014-12-16 15:47:11 -080037# Install dart_coveralls; gather and send coverage data.
Devon Carewec654872014-12-18 11:16:19 -080038if [ "$REPO_TOKEN" ]; then
39 export PATH="$PATH":"~/.pub-cache/bin"
40
41 echo
42 echo "Installing dart_coveralls"
43 pub global activate dart_coveralls
44
45 echo
46 echo "Running code coverage report"
Devon Carew0b0e65d2014-12-18 11:42:36 -080047 # --debug for verbose logging
Devon Carew236c7d22014-12-18 11:43:43 -080048 pub global run dart_coveralls report --token $REPO_TOKEN --retry 3 test/all.dart
Devon Carewec654872014-12-18 11:16:19 -080049fi