OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
8 | 8 |
9 import 'src/backend/declarer.dart'; | 9 import 'src/backend/declarer.dart'; |
10 import 'src/backend/test_platform.dart'; | 10 import 'src/backend/test_platform.dart'; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 /// | 85 /// |
86 /// If [timeout] is passed, it's used to modify or replace the default timeout | 86 /// If [timeout] is passed, it's used to modify or replace the default timeout |
87 /// of 30 seconds. Timeout modifications take precedence in suite-group-test | 87 /// of 30 seconds. Timeout modifications take precedence in suite-group-test |
88 /// order, so [timeout] will also modify any timeouts set on the group or suite. | 88 /// order, so [timeout] will also modify any timeouts set on the group or suite. |
89 /// | 89 /// |
90 /// If [skip] is a String or `true`, the test is skipped. If it's a String, it | 90 /// If [skip] is a String or `true`, the test is skipped. If it's a String, it |
91 /// should explain why the test is skipped; this reason will be printed instead | 91 /// should explain why the test is skipped; this reason will be printed instead |
92 /// of running the test. | 92 /// of running the test. |
93 /// | 93 /// |
94 /// If [tags] is passed, it declares user-defined tags that are applied to the | 94 /// If [tags] is passed, it declares user-defined tags that are applied to the |
95 /// test. These tags can be used to select or skip the test on the command line. | 95 /// test. These tags can be used to select or skip the test on the command line, |
96 /// It can be an [Iterable] of tag names, or a [String] representing a single | 96 /// or to do bulk test configuration. All tags should be declared in the |
97 /// tag. | 97 /// [package configuration file][configuring tags]. The parameter can be an |
| 98 /// [Iterable] of tag names, or a [String] representing a single tag. |
| 99 /// |
| 100 /// [configuring tags]: https://github.com/dart-lang/test/blob/master/doc/packag
e_config.md#configuring-tags |
98 /// | 101 /// |
99 /// [onPlatform] allows tests to be configured on a platform-by-platform | 102 /// [onPlatform] allows tests to be configured on a platform-by-platform |
100 /// basis. It's a map from strings that are parsed as [PlatformSelector]s to | 103 /// basis. It's a map from strings that are parsed as [PlatformSelector]s to |
101 /// annotation classes: [Timeout], [Skip], or lists of those. These | 104 /// annotation classes: [Timeout], [Skip], or lists of those. These |
102 /// annotations apply only on the given platforms. For example: | 105 /// annotations apply only on the given platforms. For example: |
103 /// | 106 /// |
104 /// test("potentially slow test", () { | 107 /// test("potentially slow test", () { |
105 /// // ... | 108 /// // ... |
106 /// }, onPlatform: { | 109 /// }, onPlatform: { |
107 /// // This test is especially slow on Windows. | 110 /// // This test is especially slow on Windows. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 /// If [timeout] is passed, it's used to modify or replace the default timeout | 145 /// If [timeout] is passed, it's used to modify or replace the default timeout |
143 /// of 30 seconds. Timeout modifications take precedence in suite-group-test | 146 /// of 30 seconds. Timeout modifications take precedence in suite-group-test |
144 /// order, so [timeout] will also modify any timeouts set on the suite, and will | 147 /// order, so [timeout] will also modify any timeouts set on the suite, and will |
145 /// be modified by any timeouts set on individual tests. | 148 /// be modified by any timeouts set on individual tests. |
146 /// | 149 /// |
147 /// If [skip] is a String or `true`, the group is skipped. If it's a String, it | 150 /// If [skip] is a String or `true`, the group is skipped. If it's a String, it |
148 /// should explain why the group is skipped; this reason will be printed instead | 151 /// should explain why the group is skipped; this reason will be printed instead |
149 /// of running the group's tests. | 152 /// of running the group's tests. |
150 /// | 153 /// |
151 /// If [tags] is passed, it declares user-defined tags that are applied to the | 154 /// If [tags] is passed, it declares user-defined tags that are applied to the |
152 /// group. These tags can be used to select or skip the group's tests on the | 155 /// test. These tags can be used to select or skip the test on the command line, |
153 /// command line. It can be an [Iterable] of tag names, or a [String] | 156 /// or to do bulk test configuration. All tags should be declared in the |
154 /// representing a single tag. | 157 /// [package configuration file][configuring tags]. The parameter can be an |
| 158 /// [Iterable] of tag names, or a [String] representing a single tag. |
| 159 /// |
| 160 /// [configuring tags]: https://github.com/dart-lang/test/blob/master/doc/packag
e_config.md#configuring-tags |
155 /// | 161 /// |
156 /// [onPlatform] allows groups to be configured on a platform-by-platform | 162 /// [onPlatform] allows groups to be configured on a platform-by-platform |
157 /// basis. It's a map from strings that are parsed as [PlatformSelector]s to | 163 /// basis. It's a map from strings that are parsed as [PlatformSelector]s to |
158 /// annotation classes: [Timeout], [Skip], or lists of those. These | 164 /// annotation classes: [Timeout], [Skip], or lists of those. These |
159 /// annotations apply only on the given platforms. For example: | 165 /// annotations apply only on the given platforms. For example: |
160 /// | 166 /// |
161 /// group("potentially slow tests", () { | 167 /// group("potentially slow tests", () { |
162 /// // ... | 168 /// // ... |
163 /// }, onPlatform: { | 169 /// }, onPlatform: { |
164 /// // These tests are especially slow on Windows. | 170 /// // These tests are especially slow on Windows. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 /// prefer [tearDown], and only use [tearDOwnAll] if the callback is | 240 /// prefer [tearDown], and only use [tearDOwnAll] if the callback is |
235 /// prohibitively slow. | 241 /// prohibitively slow. |
236 void tearDownAll(callback()) => _declarer.tearDownAll(callback); | 242 void tearDownAll(callback()) => _declarer.tearDownAll(callback); |
237 | 243 |
238 /// Registers an exception that was caught for the current test. | 244 /// Registers an exception that was caught for the current test. |
239 void registerException(error, [StackTrace stackTrace]) { | 245 void registerException(error, [StackTrace stackTrace]) { |
240 // This will usually forward directly to [Invoker.current.handleError], but | 246 // This will usually forward directly to [Invoker.current.handleError], but |
241 // going through the zone API allows other zones to consistently see errors. | 247 // going through the zone API allows other zones to consistently see errors. |
242 Zone.current.handleUncaughtError(error, stackTrace); | 248 Zone.current.handleUncaughtError(error, stackTrace); |
243 } | 249 } |
OLD | NEW |