Skip to content

Commit 1c2cc1d

Browse files
committed
Use pub run test for testing
It may be a bit slower, but * It provides more helpful errors on failure * It captures all declared tests * `all.dart` was missing `utils_test.dart` for example
1 parent 5a7ee1b commit 1c2cc1d

File tree

3 files changed

+5
-35
lines changed

3 files changed

+5
-35
lines changed

test/all.dart

Lines changed: 0 additions & 29 deletions
This file was deleted.

tool/grind.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ final Directory docsDir =
2020

2121
@Task('Analyze dartdoc to ensure there are no errors and warnings')
2222
analyze() {
23-
Analyzer.analyze(['bin/dartdoc.dart', 'lib/dartdoc.dart', 'test/all.dart'],
24-
fatalWarnings: true);
23+
Analyzer.analyze(['bin', 'lib', 'test', 'tool'], fatalWarnings: true);
2524
}
2625

2726
@Task('analyze, test, and self-test dartdoc')
@@ -181,9 +180,9 @@ publish() async {
181180

182181
@Task('Run all the tests.')
183182
test() {
184-
// this is 5 seconds faster than `pub run test`, so
185-
// using straight-up VM here
186-
return Dart.runAsync('test/all.dart', vmArgs: ['--checked']);
183+
// `pub run test` is a bit slower than running an `test_all.dart` script
184+
// But it provides more useful output in the case of failures.
185+
return Pub.runAsync('test');
187186
}
188187

189188
@Task('Generate docs for dartdoc')

tool/travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ else
5757
(cd testing/test_package_small; dart -c ../../bin/dartdoc.dart)
5858

5959
# Run the tests.
60-
pub run grinder test
60+
pub run test
6161
fi

0 commit comments

Comments
 (0)