From 723e5f790b77551b15ba149219c21d757968e523 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Tue, 8 Dec 2015 14:09:47 -0800 Subject: [PATCH 1/2] Update testing instructions per abarths' feedback https://github.com/flutter/flutter/commit/724388d24f5f1f9ea2ddc7571f62da68ea776d0f --- CONTRIBUTING.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e87e5c3d92..7cd9679d63 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,12 +78,21 @@ 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: - * `cd packages/newton` + * `cd examples/stocks` * `flutter test` +Individual tests can also be run directly, e.g. `flutter test lib/my_app_test.dart` + Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree/master/packages/flutter_test) which provides flutter-specific extensions on top of [package:test](https://pub.dartlang.org/packages/test). -`flutter test --flutter-repo` is a shortcut for those working on the flutter package itself which finds and runs all tests inside the flutter repository regardless of the current working directory. +`flutter test` runs tests inside the flutter shell. Some packages inside the flutter repository can be run inside the dart command line VM as well as the flutter shell, `packages/newton` and `packages/flutter_tools` are two such examples: + + * `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. + +If you've built [your own flutter engine](#working-on-the-engine-and-the-framework-at-the-same-time), you can pass `--engine-src-path` to change what flutter shell `flutter test` uses. 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 From b55acb4b16a119638ccffefe0c1e2d73e5ff0d95 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Tue, 8 Dec 2015 14:38:03 -0800 Subject: [PATCH 2/2] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7cd9679d63..67924b52bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,7 +92,7 @@ Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree `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. -If you've built [your own flutter engine](#working-on-the-engine-and-the-framework-at-the-same-time), you can pass `--engine-src-path` 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. 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