Merge pull request #954 from Hixie/unit-to-flutter
Move flutter tests from packages/unit to packages/flutter/test
This commit is contained in:
commit
b8562aba60
@ -76,7 +76,7 @@ own code by mimicking the `pubspec.yaml` files in the `examples` subdirectories.
|
||||
Running the tests
|
||||
-----------------
|
||||
|
||||
To automatically find all files named `_test.dart` inside a package and run them inside the flutter shell as a test use the `flutter test` command, e.g:
|
||||
To automatically find all files named `_test.dart` inside a package's `test/` subdirectory, and run them inside the flutter shell as a test, use the `flutter test` command, e.g:
|
||||
|
||||
* `cd examples/stocks`
|
||||
* `flutter test`
|
||||
@ -90,9 +90,11 @@ Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree
|
||||
* `cd packages/newton`
|
||||
* `pub run test`
|
||||
|
||||
`flutter test --flutter-repo` is a shortcut for those working on the flutter repository itself which finds and runs all tests inside the flutter repository regardless of the current working directory.
|
||||
`flutter test --flutter-repo` is a shortcut for those working on the flutter repository itself which runs all tests inside the `flutter` package regardless of the current working directory.
|
||||
To run all the tests for the entire Flutter repository, the same way that Travis runs them, run `travis/test.sh`.
|
||||
|
||||
If you've built [your own flutter engine](#working-on-the-engine-and-the-framework-at-the-same-time), you can pass `--debug` or `--release` to change what flutter shell `flutter test` uses.
|
||||
To do this with the `travis/test.sh` script, you can use the `FLUTTER_ENGINE` environment variable.
|
||||
|
||||
Note: Flutter tests are headless, you won't see any UI. You can use
|
||||
`print` to generate console output or you can interact with the DartVM
|
||||
@ -101,9 +103,9 @@ via observatory at [http://localhost:8181/](http://localhost:8181/).
|
||||
Adding a test
|
||||
-------------
|
||||
|
||||
To add a test, simply create a file whose name ends with `_test.dart`
|
||||
in the `packages/unit/test` directory. The test should have a `main`
|
||||
function and use the `test` package.
|
||||
To add a test to the Flutter package, simply create a file whose name
|
||||
ends with `_test.dart` in the `packages/flutter/test` directory. The
|
||||
test should have a `main` function and use the `test` package.
|
||||
|
||||
Contributing code
|
||||
-----------------
|
||||
|
@ -2,8 +2,8 @@ name: stocks
|
||||
dependencies:
|
||||
flutter:
|
||||
path: ../../packages/flutter
|
||||
|
||||
intl: '>=0.12.4+2 <0.13.0'
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
path: ../../packages/flutter_test
|
||||
|
@ -6,6 +6,6 @@ homepage: https://github.com/flutter/flutter/tree/master/packages/cassowary
|
||||
environment:
|
||||
sdk: '>=1.0.0 <2.0.0'
|
||||
dev_dependencies:
|
||||
test: 0.12.6+1
|
||||
test_runner: '<=0.2.16'
|
||||
dart_coveralls: '<=0.3.0'
|
||||
flutter_tools:
|
||||
path: ../flutter_tools
|
||||
test: any # constrained by the dependency in flutter_tools
|
||||
|
@ -3,6 +3,7 @@ version: 0.0.21
|
||||
author: Flutter Authors <flutter-dev@googlegroups.com>
|
||||
description: A framework for writing Flutter applications
|
||||
homepage: http://flutter.io
|
||||
|
||||
dependencies:
|
||||
collection: '>=1.1.3 <2.0.0'
|
||||
intl: '>=0.12.4+2 <0.13.0'
|
||||
@ -11,7 +12,9 @@ dependencies:
|
||||
sky_services: 0.0.73
|
||||
vector_math: '>=1.4.3 <2.0.0'
|
||||
|
||||
# To pin the transitive dependency through mojo_sdk.
|
||||
# See the comment in flutter_tools' pubspec.yaml. We have to pin it
|
||||
# here also because sky_services depends on mojo_sdk which depends
|
||||
# on test.
|
||||
test: 0.12.6+1
|
||||
|
||||
cassowary:
|
||||
@ -19,5 +22,9 @@ dependencies:
|
||||
newton:
|
||||
path: ../newton
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
path: ../flutter_test
|
||||
|
||||
environment:
|
||||
sdk: '>=1.12.0 <2.0.0'
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user