|
10 | 10 | * [Collecting Code Coverage](#collecting-code-coverage)
|
11 | 11 | * [Restricting Tests to Certain Platforms](#restricting-tests-to-certain-platforms)
|
12 | 12 | * [Platform Selectors](#platform-selectors)
|
| 13 | + * [Compiler Selectors](#compiler-selectors) |
13 | 14 | * [Running Tests on Node.js](#running-tests-on-nodejs)
|
14 | 15 | * [Asynchronous Tests](#asynchronous-tests)
|
15 | 16 | * [Stream Matchers](#stream-matchers)
|
@@ -184,6 +185,12 @@ reported on the command line just like for VM tests. In fact, you can even run
|
184 | 185 | tests on both platforms with a single command: `dart test -p "chrome,vm"
|
185 | 186 | path/to/test.dart`.
|
186 | 187 |
|
| 188 | +By default each platform has a default compiler, but some of them support |
| 189 | +more than one compiler. You can choose which compiler to use by passing |
| 190 | +`dart test -c source`, which would run all VM tests from source instead of |
| 191 | +compiling them to kernel. This also supports targetting a specific platform |
| 192 | +using normal platform selectors, like this `dart test -c vm:source`. |
| 193 | + |
187 | 194 | ### Test Path Queries
|
188 | 195 |
|
189 | 196 | Some query parameters are supported on test paths, which allow you to filter the
|
@@ -381,6 +388,14 @@ only supports boolean operations. The following identifiers are defined:
|
381 | 388 | * `posix`: Whether the test is running on a POSIX operating system. This is
|
382 | 389 | equivalent to `!windows`.
|
383 | 390 |
|
| 391 | +* `dart2js`: Whether the test has been compiled with Dart2Js. |
| 392 | + |
| 393 | +* `dart2wasm`: Whether the test has been compiled with Dart2Wasm. |
| 394 | + |
| 395 | +* `kernel`: Whether the test has been compiled to kernel. |
| 396 | + |
| 397 | +* `source`: Whether the test has been run with no compiler (from source). |
| 398 | + |
384 | 399 | For example, if you wanted to run a test on every browser but Chrome, you would
|
385 | 400 | write `@TestOn('browser && !chrome')`.
|
386 | 401 |
|
|
0 commit comments