mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
[flutter_tools] tweak README (#84648)
This commit is contained in:
parent
a2336e9ac7
commit
1b981a6869
@ -42,7 +42,8 @@ Tests live under the `test/` subdirectory.
|
|||||||
- Hermetic unit tests of tool internals go under `test/general.shard`.
|
- Hermetic unit tests of tool internals go under `test/general.shard`.
|
||||||
- Tests of tool commands go under `test/commands.shard`. Hermetic tests go under
|
- Tests of tool commands go under `test/commands.shard`. Hermetic tests go under
|
||||||
its `hermetic/` subdirectory. Non-hermetic tests go under its `permeable`
|
its `hermetic/` subdirectory. Non-hermetic tests go under its `permeable`
|
||||||
sub-directory.
|
sub-directory. Avoid adding tests here and prefer writing either a unit test or a full
|
||||||
|
integration test.
|
||||||
- Integration tests (e.g. tests that run the tool in a subprocess) go under
|
- Integration tests (e.g. tests that run the tool in a subprocess) go under
|
||||||
`test/integration.shard`.
|
`test/integration.shard`.
|
||||||
|
|
||||||
@ -66,18 +67,20 @@ flutter test test/integration.shard/some_test_case
|
|||||||
|
|
||||||
### Running the tests
|
### Running the tests
|
||||||
|
|
||||||
To run the tests in the `test/` directory:
|
To run all of the unit tests:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ flutter test
|
$ flutter test test/general.shard
|
||||||
```
|
```
|
||||||
|
|
||||||
The tests in `test/integration.shard` are slower to run than the tests in
|
The tests in `test/integration.shard` are slower to run than the tests in
|
||||||
`test/general.shard`. Depending on your development computer, you might
|
`test/general.shard`. Depending on your development computer, you might
|
||||||
want to increase timeouts and limit concurrency.
|
want to increase timeouts and limit concurrency. Generally it is easier to run
|
||||||
|
these on CI, or to manually verify the behavior you are changing instead of running
|
||||||
|
the test.
|
||||||
|
|
||||||
The integration tests also require the `FLUTTER_ROOT` environment variable
|
The integration tests also require the `FLUTTER_ROOT` environment variable
|
||||||
to be set.
|
to be set. The full invocation to run everything might therefore look something like:
|
||||||
The full invocation to run everything might therefore look something like:
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ FLUTTER_ROOT=~/path/to/flutter-sdk
|
$ FLUTTER_ROOT=~/path/to/flutter-sdk
|
||||||
|
Loading…
Reference in New Issue
Block a user