| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details. | 3 # Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details. |
| 4 # All rights reserved. Use of this source code is governed by a BSD-style | 4 # All rights reserved. Use of this source code is governed by a BSD-style |
| 5 # license that can be found in the LICENSE file. | 5 # license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 # Fast fail the script on failures. | 7 # Fast fail the script on failures. |
| 8 set -e | 8 set -e |
| 9 | 9 |
| 10 # Verify that the libraries are error and warning-free. | 10 # Verify that the libraries are error and warning-free. |
| 11 echo "Running dartanalyzer..." | 11 echo "Running dartanalyzer..." |
| 12 libs=$(find lib -maxdepth 1 -type f -name '*.dart') | 12 libs=$(find lib -maxdepth 1 -type f -name '*.dart') |
| 13 testing_libs=$(find lib/testing -maxdepth 1 -type f -name '*.dart') | 13 testing_libs=$(find lib/testing -maxdepth 1 -type f -name '*.dart') |
| 14 dartanalyzer $DARTANALYZER_FLAGS $libs $testing_libs test/all_tests.dart | 14 dartanalyzer $DARTANALYZER_FLAGS $libs $testing_libs test/all_tests.dart |
| 15 | 15 |
| 16 # Verify that dartfmt has been run |
| 17 if [[ "$TRAVIS_DART_VERSION" == "stable" ]]; then |
| 18 # Only test on stable to avoid CI failure due to diffs between stable and dev. |
| 19 echo "Checking dartfmt..." |
| 20 if [[ $(dartfmt -n --set-exit-if-changed lib/ test/) ]]; then |
| 21 echo "Failed dartfmt check: run dartfmt -w lib/ test/" |
| 22 exit 1 |
| 23 fi |
| 24 fi |
| 25 |
| 16 # Run the tests. | 26 # Run the tests. |
| 17 echo "Running tests..." | 27 echo "Running tests..." |
| 18 pub run test:test | 28 pub run test:test |
| 19 | 29 |
| 20 # Gather and send coverage data. | 30 # Gather and send coverage data. |
| 21 if [ "$REPO_TOKEN" ] && [ "$TRAVIS_DART_VERSION" = "stable" ]; then | 31 if [ "$REPO_TOKEN" ] && [ "$TRAVIS_DART_VERSION" = "stable" ]; then |
| 22 echo "Collecting coverage..." | 32 echo "Collecting coverage..." |
| 23 pub global activate dart_coveralls | 33 pub global activate dart_coveralls |
| 24 pub global run dart_coveralls report \ | 34 pub global run dart_coveralls report \ |
| 25 --token $REPO_TOKEN \ | 35 --token $REPO_TOKEN \ |
| 26 --retry 2 \ | 36 --retry 2 \ |
| 27 --exclude-test-files \ | 37 --exclude-test-files \ |
| 28 test/all_tests.dart | 38 test/all_tests.dart |
| 29 fi | 39 fi |
| OLD | NEW |