Skip to content

add coveralls support #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion test/asset/file_based_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/package_graph/package_graph_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:test/test.dart';

import 'package:build/build.dart';

main() async {
main() {
PackageGraph graph;

group('forThisPackage ', () {
Expand Down
35 changes: 35 additions & 0 deletions tool/create_test_all.dart
Original file line number Diff line number Diff line change
@@ -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';
''';
11 changes: 11 additions & 0 deletions tool/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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