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

Unified Diff: lib/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/src/runner/reporter/no_io_compact.dart ('k') | test/runner/compact_reporter_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/test.dart
diff --git a/lib/test.dart b/lib/test.dart
index 3839fe7f9aee0b6fa368d77d3966c27b3008cc10..75539a727b3bc5c0f9056a767d9ac9ee63f9b204 100644
--- a/lib/test.dart
+++ b/lib/test.dart
@@ -72,8 +72,14 @@ Declarer get _declarer {
/// If [timeout] is passed, it's used to modify or replace the default timeout
/// of 30 seconds. Timeout modifications take precedence in suite-group-test
/// order, so [timeout] will also modify any timeouts set on the group or suite.
-void test(String description, body(), {String testOn, Timeout timeout}) =>
- _declarer.test(description, body, testOn: testOn, timeout: timeout);
+///
+/// If [skip] is a String or `true`, the test is skipped. If it's a String, it
+/// should explain why the test is skipped; this reason will be printed instead
+/// of running the test.
+void test(String description, body(), {String testOn, Timeout timeout,
+ skip}) =>
+ _declarer.test(description, body,
+ testOn: testOn, timeout: timeout, skip: skip);
/// Creates a group of tests.
///
@@ -90,8 +96,14 @@ void test(String description, body(), {String testOn, Timeout timeout}) =>
/// of 30 seconds. Timeout modifications take precedence in suite-group-test
/// order, so [timeout] will also modify any timeouts set on the suite, and will
/// be modified by any timeouts set on individual tests.
-void group(String description, void body(), {String testOn, Timeout timeout}) =>
- _declarer.group(description, body, testOn: testOn, timeout: timeout);
+///
+/// If [skip] is a String or `true`, the group is skipped. If it's a String, it
+/// should explain why the group is skipped; this reason will be printed instead
+/// of running the group's tests.
+void group(String description, void body(), {String testOn, Timeout timeout,
+ skip}) =>
+ _declarer.group(description, body,
+ testOn: testOn, timeout: timeout, skip: skip);
/// Registers a function to be run before tests.
///
« no previous file with comments | « lib/src/runner/reporter/no_io_compact.dart ('k') | test/runner/compact_reporter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698