Chromium Code Reviews| Index: lib/src/backend/declarer.dart |
| diff --git a/lib/src/backend/declarer.dart b/lib/src/backend/declarer.dart |
| index 01e814072b0021cda70bb44126a5f560c674130f..36b4aea5360e6aba4680c623107c2036e87b99a3 100644 |
| --- a/lib/src/backend/declarer.dart |
| +++ b/lib/src/backend/declarer.dart |
| @@ -38,14 +38,19 @@ class Declarer { |
| /// 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}) { |
| + /// |
| + /// 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 in |
| + /// lieu of running the test. |
|
kevmoo
2015/04/17 22:53:34
in lieu -> instead
more simple English are better
nweiz
2015/04/17 22:56:12
Done.
|
| + void test(String description, body(), {String testOn, Timeout timeout, |
| + skip}) { |
| // TODO(nweiz): Once tests have begun running, throw an error if [test] is |
| // called. |
| var prefix = _group.description; |
| if (prefix != null) description = "$prefix $description"; |
| var metadata = _group.metadata.merge( |
| - new Metadata.parse(testOn: testOn, timeout: timeout)); |
| + new Metadata.parse(testOn: testOn, timeout: timeout, skip: skip)); |
| var group = _group; |
| _tests.add(new LocalTest(description, metadata, () { |
| // TODO(nweiz): It might be useful to throw an error here if a test starts |
| @@ -68,11 +73,23 @@ class Declarer { |
| /// 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. |
| + /// |
| + /// 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 in |
| + /// lieu of running the group's tests. |
|
kevmoo
2015/04/17 22:53:34
same righch 'ere
|
| void group(String description, void body(), {String testOn, |
| - Timeout timeout}) { |
| + Timeout timeout, skip}) { |
| var oldGroup = _group; |
| - var metadata = new Metadata.parse(testOn: testOn, timeout: timeout); |
| + var metadata = new Metadata.parse( |
| + testOn: testOn, timeout: timeout, skip: skip); |
| + |
| + // Don' load the tests for a skipped group. |
| + if (metadata.skip) { |
| + _tests.add(new LocalTest(description, metadata, () {})); |
| + return; |
| + } |
| + |
| _group = new Group(oldGroup, description, metadata); |
| try { |
| body(); |