From 562a231b017a91a209d3457cece07eb3a92786d6 Mon Sep 17 00:00:00 2001 From: Seth Ladd Date: Mon, 5 Jan 2015 15:51:19 -0800 Subject: [PATCH 1/3] first cut at code coverage --- README.md | 2 ++ tool/travis.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) 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/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 From 9e86a37e13547c506936238fa947aaad3fbfff3b Mon Sep 17 00:00:00 2001 From: Seth Ladd Date: Mon, 5 Jan 2015 16:24:53 -0800 Subject: [PATCH 2/3] added a test that triggers coverage --- test/all.dart | 2 ++ test/model_test.dart | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/model_test.dart 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..576bc88a0c --- /dev/null +++ b/test/model_test.dart @@ -0,0 +1,18 @@ +// Copyright (c) 2014, 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')); + }); + }); +} From c84b066fdad6e6532e3ed0c4e17aa74da95c6d38 Mon Sep 17 00:00:00 2001 From: Seth Ladd Date: Tue, 6 Jan 2015 08:24:53 -0800 Subject: [PATCH 3/3] fix date in copyright --- test/model_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/model_test.dart b/test/model_test.dart index 576bc88a0c..9beed43040 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +// 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.