Skip to content

Commit b075c5d

Browse files
authored
udpate docs for the compiler option (#1916)
1 parent 6eb1cd1 commit b075c5d

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

pkgs/test/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* [Collecting Code Coverage](#collecting-code-coverage)
1111
* [Restricting Tests to Certain Platforms](#restricting-tests-to-certain-platforms)
1212
* [Platform Selectors](#platform-selectors)
13+
* [Compiler Selectors](#compiler-selectors)
1314
* [Running Tests on Node.js](#running-tests-on-nodejs)
1415
* [Asynchronous Tests](#asynchronous-tests)
1516
* [Stream Matchers](#stream-matchers)
@@ -184,6 +185,12 @@ reported on the command line just like for VM tests. In fact, you can even run
184185
tests on both platforms with a single command: `dart test -p "chrome,vm"
185186
path/to/test.dart`.
186187

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+
187194
### Test Path Queries
188195

189196
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:
381388
* `posix`: Whether the test is running on a POSIX operating system. This is
382389
equivalent to `!windows`.
383390

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+
384399
For example, if you wanted to run a test on every browser but Chrome, you would
385400
write `@TestOn('browser && !chrome')`.
386401

pkgs/test/doc/configuration.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ verbose_trace: true
121121

122122
### `chain_stack_traces`
123123

124-
This boolean field controls whether or not stack traces are chained.
124+
This boolean field controls whether or not stack traces are chained.
125125
Disabling [`stack trace chaining`][stack trace chaining] will improve
126-
performance for heavily asynchronous code at the cost of debuggability.
126+
performance for heavily asynchronous code at the cost of debuggability.
127127

128128
[stack trace chaining]: https://github.com/dart-lang/stack_trace/blob/master/README.md#stack-chains
129129

130130
```yaml
131-
chain_stack_traces: false
131+
chain_stack_traces: false
132132
```
133133

134134
### `js_trace`
@@ -163,7 +163,7 @@ This field is not supported in the
163163

164164
### `retry`
165165

166-
This int field controls how many times a test is retried upon failure.
166+
This int field controls how many times a test is retried upon failure.
167167

168168
```yaml
169169
tags:
@@ -417,6 +417,19 @@ platforms:
417417
- firefox
418418
```
419419

420+
### `compilers`
421+
422+
This field indicates which compilers tests should be compiled with by default.
423+
It allows the same compiler selectors that can be passed to `--compiler`. If
424+
a given platform has no supported compiler configured, it will use its default.
425+
426+
```yaml
427+
compilers: [source]
428+
429+
compilers:
430+
- source
431+
```
432+
420433
### `concurrency`
421434

422435
This field indicates the default number of test suites to run in parallel. More
@@ -511,8 +524,8 @@ package are folded.
511524
```yaml
512525
fold_stack_frames:
513526
except:
514-
- test
515-
- stream_channel
527+
- test
528+
- stream_channel
516529
```
517530

518531
Sample stack trace, note the absence of `package:test`

0 commit comments

Comments
 (0)