diff --git a/README.md b/README.md index cb9364e53..f35350d4b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# build [![Build Status](https://travis-ci.org/dart-lang/build.svg?branch=master)](https://travis-ci.org/dart-lang/build) +# build [![Build Status](https://travis-ci.org/dart-lang/build.svg?branch=master)](https://travis-ci.org/dart-lang/build) [![Coverage Status](https://coveralls.io/repos/dart-lang/build/badge.svg?branch=master)](https://coveralls.io/r/dart-lang/build) A build system for Dart. diff --git a/test/asset/file_based_test.dart b/test/asset/file_based_test.dart index b6dda3989..b63e48fef 100644 --- a/test/asset/file_based_test.dart +++ b/test/asset/file_based_test.dart @@ -12,7 +12,7 @@ import '../common/common.dart'; final packageGraph = new PackageGraph.forPath('test/fixtures/basic_pkg'); -main() async { +main() { group('FileBasedAssetReader', () { final reader = new FileBasedAssetReader(packageGraph); diff --git a/test/package_graph/package_graph_test.dart b/test/package_graph/package_graph_test.dart index cfa00534b..0efa8509f 100644 --- a/test/package_graph/package_graph_test.dart +++ b/test/package_graph/package_graph_test.dart @@ -6,7 +6,7 @@ import 'package:test/test.dart'; import 'package:build/build.dart'; -main() async { +main() { PackageGraph graph; group('forThisPackage ', () { diff --git a/tool/create_test_all.dart b/tool/create_test_all.dart new file mode 100755 index 000000000..affd656f2 --- /dev/null +++ b/tool/create_test_all.dart @@ -0,0 +1,35 @@ +// Copyright (c) 2016, 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. +import 'dart:io'; + +import 'package:glob/glob.dart'; + +main() async { + var imports = new StringBuffer(); + var groupCalls = new StringBuffer(); + var i = 0; + await for (var file in _testGlob.list(followLinks: false)) { + imports.writeln('import \'../${file.path}\' as i$i;'); + groupCalls.writeln(' group(\'${file.path}\', i$i.main);'); + i++; + } + + var file = new File('tool/test_all.dart'); + await file.writeAsString(''' +$_header +$imports +main() { +$groupCalls +} + '''); +} + +final _testGlob = new Glob('test/**/*_test.dart'); + +const _header = ''' +// Copyright (c) 2016, 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. +import 'package:test/test.dart'; +'''; diff --git a/tool/travis.sh b/tool/travis.sh index b77153f1a..92bc590bd 100755 --- a/tool/travis.sh +++ b/tool/travis.sh @@ -13,3 +13,14 @@ dartanalyzer --fatal-warnings \ # Run the tests. pub run test + +# Install dart_coveralls; gather and send coverage data. +if [ "$COVERALLS_TOKEN" ] && [ "$TRAVIS_DART_VERSION" = "stable" ]; then + dart tool/create_test_all.dart + pub global activate dart_coveralls + pub global run dart_coveralls report \ + --retry 2 \ + --exclude-test-files \ + tool/test_all.dart + rm tool/test_all.dart +fi