Commit 7151fdd0 authored by Ian Hickson's avatar Ian Hickson

Move flutter tests from packages/unit to packages/flutter/test

parent 1d39db69
...@@ -76,7 +76,7 @@ own code by mimicking the `pubspec.yaml` files in the `examples` subdirectories. ...@@ -76,7 +76,7 @@ own code by mimicking the `pubspec.yaml` files in the `examples` subdirectories.
Running the tests 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` * `cd examples/stocks`
* `flutter test` * `flutter test`
...@@ -90,9 +90,11 @@ Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree ...@@ -90,9 +90,11 @@ Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree
* `cd packages/newton` * `cd packages/newton`
* `pub run test` * `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. 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 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 `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/). ...@@ -101,9 +103,9 @@ via observatory at [http://localhost:8181/](http://localhost:8181/).
Adding a test Adding a test
------------- -------------
To add a test, simply create a file whose name ends with `_test.dart` To add a test to the Flutter package, simply create a file whose name
in the `packages/unit/test` directory. The test should have a `main` ends with `_test.dart` in the `packages/flutter/test` directory. The
function and use the `test` package. test should have a `main` function and use the `test` package.
Contributing code Contributing code
----------------- -----------------
......
...@@ -2,8 +2,8 @@ name: stocks ...@@ -2,8 +2,8 @@ name: stocks
dependencies: dependencies:
flutter: flutter:
path: ../../packages/flutter path: ../../packages/flutter
intl: '>=0.12.4+2 <0.13.0' intl: '>=0.12.4+2 <0.13.0'
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
path: ../../packages/flutter_test path: ../../packages/flutter_test
...@@ -6,6 +6,6 @@ homepage: https://github.com/flutter/flutter/tree/master/packages/cassowary ...@@ -6,6 +6,6 @@ homepage: https://github.com/flutter/flutter/tree/master/packages/cassowary
environment: environment:
sdk: '>=1.0.0 <2.0.0' sdk: '>=1.0.0 <2.0.0'
dev_dependencies: dev_dependencies:
test: 0.12.6+1 flutter_tools:
test_runner: '<=0.2.16' path: ../flutter_tools
dart_coveralls: '<=0.3.0' test: any # constrained by the dependency in flutter_tools
...@@ -3,6 +3,7 @@ version: 0.0.21 ...@@ -3,6 +3,7 @@ version: 0.0.21
author: Flutter Authors <flutter-dev@googlegroups.com> author: Flutter Authors <flutter-dev@googlegroups.com>
description: A framework for writing Flutter applications description: A framework for writing Flutter applications
homepage: http://flutter.io homepage: http://flutter.io
dependencies: dependencies:
collection: '>=1.1.3 <2.0.0' collection: '>=1.1.3 <2.0.0'
intl: '>=0.12.4+2 <0.13.0' intl: '>=0.12.4+2 <0.13.0'
...@@ -11,7 +12,9 @@ dependencies: ...@@ -11,7 +12,9 @@ dependencies:
sky_services: 0.0.73 sky_services: 0.0.73
vector_math: '>=1.4.3 <2.0.0' 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 test: 0.12.6+1
cassowary: cassowary:
...@@ -19,5 +22,9 @@ dependencies: ...@@ -19,5 +22,9 @@ dependencies:
newton: newton:
path: ../newton path: ../newton
dev_dependencies:
flutter_test:
path: ../flutter_test
environment: environment:
sdk: '>=1.12.0 <2.0.0' sdk: '>=1.12.0 <2.0.0'
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment