Skip to content

Commit

Permalink
add coveralls support
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemac53 committed Feb 4, 2016
1 parent 3c3f7f7 commit 6dd5708
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
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
}
''');
}

Glob _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

0 comments on commit 6dd5708

Please sign in to comment.