diff --git a/README.md b/README.md index 6f26a949f2..4db9f39c95 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ A documentation generator for Dart. [![Build Status](https://travis-ci.org/dart-lang/dartdoc.svg)](https://travis-ci.org/dart-lang/dartdoc) +[![Coverage Status](https://img.shields.io/coveralls/dart-lang/dartdoc.svg)](https://coveralls.io/r/dart-lang/dartdoc) + Note: This tool is currently in pre-alpha stage. ## FAQ diff --git a/test/all.dart b/test/all.dart index 19b466c21c..7faed11a34 100644 --- a/test/all.dart +++ b/test/all.dart @@ -5,7 +5,9 @@ library dartdoc.all_tests; import 'template_test.dart' as template_tests; +import 'model_test.dart' as model_tests; main() { template_tests.tests(); + model_tests.tests(); } diff --git a/test/model_test.dart b/test/model_test.dart new file mode 100644 index 0000000000..9beed43040 --- /dev/null +++ b/test/model_test.dart @@ -0,0 +1,18 @@ +// Copyright (c) 2015, 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. + +library dartdoc.model_test; + +import 'package:dartdoc/src/model.dart'; +import 'package:unittest/unittest.dart'; + +tests() { + group('Class', () { + + test('has correct type name', () { + var c = new Class(null, null); + expect(c.typeName, equals('Classes')); + }); + }); +} diff --git a/tool/travis.sh b/tool/travis.sh index 12536b4893..2d264f0724 100755 --- a/tool/travis.sh +++ b/tool/travis.sh @@ -31,3 +31,13 @@ dartanalyzer --fatal-warnings \ # Run the tests. dart test/all.dart + +# Gather and send coverage data. +if [ "$REPO_TOKEN" ]; then + pub global activate dart_coveralls + pub global run dart_coveralls report \ + --token $REPO_TOKEN \ + --retry 2 \ + --exclude-test-files \ + test/all.dart +fi \ No newline at end of file