Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Unified Diff: test/runner/compact_reporter_test.dart

Issue 1093633004: Add test- and group-level support for skipping tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/test.dart ('k') | test/runner/engine_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/compact_reporter_test.dart
diff --git a/test/runner/compact_reporter_test.dart b/test/runner/compact_reporter_test.dart
index 88eb98cd3a5a40031b880dd2a6b6a5cf4409e939..88e74f550519e5773adef263203953e703cf05f5 100644
--- a/test/runner/compact_reporter_test.dart
+++ b/test/runner/compact_reporter_test.dart
@@ -230,6 +230,89 @@ void main() {
+1 -1: Some tests failed.""");
});
});
+
+ group("skip:", () {
+ test("displays skipped tests separately", () {
+ _expectReport("""
+ test('skip 1', () {}, skip: true);
+ test('skip 2', () {}, skip: true);
+ test('skip 3', () {}, skip: true);""",
+ """
+ +0: skip 1
+ +0 ~1: skip 1
+ +0 ~1: skip 2
+ +0 ~2: skip 2
+ +0 ~2: skip 3
+ +0 ~3: skip 3
+ +0 ~3: All tests skipped.""");
+ });
+
+ test("runs skipped tests along with successful tests", () {
+ _expectReport("""
+ test('skip 1', () {}, skip: true);
+ test('success 1', () {});
+ test('skip 2', () {}, skip: true);
+ test('success 2', () {});""",
+ """
+ +0: skip 1
+ +0 ~1: skip 1
+ +0 ~1: success 1
+ +1 ~1: success 1
+ +1 ~1: skip 2
+ +1 ~2: skip 2
+ +1 ~2: success 2
+ +2 ~2: success 2
+ +2 ~2: All tests passed!""");
+ });
+
+ test("runs skipped tests along with successful and failing tests", () {
+ _expectReport("""
+ test('failure 1', () => throw new TestFailure('oh no'));
+ test('skip 1', () {}, skip: true);
+ test('success 1', () {});
+ test('failure 2', () => throw new TestFailure('oh no'));
+ test('skip 2', () {}, skip: true);
+ test('success 2', () {});""",
+ """
+ +0: failure 1
+ +0 -1: failure 1
+ oh no
+ test.dart 6:35 main.<fn>
+
+
+ +0 -1: skip 1
+ +0 ~1 -1: skip 1
+ +0 ~1 -1: success 1
+ +1 ~1 -1: success 1
+ +1 ~1 -1: failure 2
+ +1 ~1 -2: failure 2
+ oh no
+ test.dart 9:35 main.<fn>
+
+
+ +1 ~1 -2: skip 2
+ +1 ~2 -2: skip 2
+ +1 ~2 -2: success 2
+ +2 ~2 -2: success 2
+ +2 ~2 -2: Some tests failed.""");
+ });
+
+ test("displays the skip reason if available", () {
+ _expectReport("""
+ test('skip 1', () {}, skip: 'some reason');
+ test('skip 2', () {}, skip: 'or another');""",
+ """
+ +0: skip 1
+ +0 ~1: skip 1
+ Skip: some reason
+
+ +0 ~1: skip 2
+ +0 ~2: skip 2
+ Skip: or another
+
+ +0 ~2: All tests skipped.""");
+ });
+ });
}
void _expectReport(String tests, String expected, {List<String> args,
« no previous file with comments | « lib/test.dart ('k') | test/runner/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698