Devon Carew | 26ceabe | 2014-12-11 11:44:53 -0800 | [diff] [blame] | 1 | #!/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. |
| 8 | set -e |
| 9 | |
| 10 | # Get the Dart SDK. |
| 11 | DART_DIST=dartsdk-linux-x64-release.zip |
| 12 | curl http://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/$DART_DIST > $DART_DIST |
| 13 | unzip $DART_DIST > /dev/null |
| 14 | rm $DART_DIST |
| 15 | export DART_SDK="$PWD/dart-sdk" |
Devon Carew | 03d0520 | 2014-12-17 14:45:26 -0800 | [diff] [blame] | 16 | export PATH="$DART_SDK/bin:$PATH" |
Devon Carew | 26ceabe | 2014-12-11 11:44:53 -0800 | [diff] [blame] | 17 | |
| 18 | # Display installed versions. |
| 19 | dart --version |
| 20 | |
| 21 | # Get our packages. |
| 22 | pub get |
| 23 | |
| 24 | # Verify that the libraries are error free. |
| 25 | dartanalyzer --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. |
| 32 | dart test/all.dart |
Devon Carew | 55ee303 | 2014-12-16 15:47:11 -0800 | [diff] [blame] | 33 | |
Devon Carew | b1fa88f | 2014-12-21 08:48:52 -0800 | [diff] [blame^] | 34 | # Measure the size of the compiled JS, for the dart:html version of the library. |
| 35 | dart tool/grind.dart build |
| 36 | |
Devon Carew | 55ee303 | 2014-12-16 15:47:11 -0800 | [diff] [blame] | 37 | # Install dart_coveralls; gather and send coverage data. |
Devon Carew | ec65487 | 2014-12-18 11:16:19 -0800 | [diff] [blame] | 38 | if [ "$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 Carew | 0b0e65d | 2014-12-18 11:42:36 -0800 | [diff] [blame] | 47 | # --debug for verbose logging |
Devon Carew | 236c7d2 | 2014-12-18 11:43:43 -0800 | [diff] [blame] | 48 | pub global run dart_coveralls report --token $REPO_TOKEN --retry 3 test/all.dart |
Devon Carew | ec65487 | 2014-12-18 11:16:19 -0800 | [diff] [blame] | 49 | fi |