diff --git a/dev/automated_tests/flutter_test/trivial_widget_expectation.txt b/dev/automated_tests/flutter_test/trivial_widget_expectation.txt index 1e033e60d5..cda62d712c 100644 --- a/dev/automated_tests/flutter_test/trivial_widget_expectation.txt +++ b/dev/automated_tests/flutter_test/trivial_widget_expectation.txt @@ -1,2 +1 @@ -[0-9]+:[0-9]+ [+]0: A trivial widget test [0-9]+:[0-9]+ [+]1: All tests passed! diff --git a/dev/bots/test.dart b/dev/bots/test.dart index e5f8c451d2..169c4cf951 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -135,61 +135,52 @@ Future _analyzeRepo() async { print('${bold}DONE: Analysis successful.$reset'); } -Future _runTests({List options: const []}) async { +Future _runTests() async { // Verify that the tests actually return failure on failure and success on success. final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests'); await _runFlutterTest(automatedTests, script: path.join('test_smoke_test', 'fail_test.dart'), - options: options, expectFailure: true, printOutput: false, timeout: _kShortTimeout, ); await _runFlutterTest(automatedTests, script: path.join('test_smoke_test', 'pass_test.dart'), - options: options, printOutput: false, timeout: _kShortTimeout, ); await _runFlutterTest(automatedTests, script: path.join('test_smoke_test', 'crash1_test.dart'), - options: options, expectFailure: true, printOutput: false, timeout: _kShortTimeout, ); await _runFlutterTest(automatedTests, script: path.join('test_smoke_test', 'crash2_test.dart'), - options: options, expectFailure: true, printOutput: false, timeout: _kShortTimeout, ); await _runFlutterTest(automatedTests, script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'), - options: options, expectFailure: true, printOutput: false, timeout: _kShortTimeout, ); await _runFlutterTest(automatedTests, script: path.join('test_smoke_test', 'missing_import_test.broken_dart'), - options: options, expectFailure: true, printOutput: false, timeout: _kShortTimeout, ); await _runFlutterTest(automatedTests, script: path.join('test_smoke_test', 'disallow_error_reporter_modification_test.dart'), - options: options, expectFailure: true, printOutput: false, timeout: _kShortTimeout, ); await _runCommand(flutter, - ['drive', '--use-existing-app'] - ..addAll(options) - ..addAll([ '-t', path.join('test_driver', 'failure.dart')]), + ['drive', '--use-existing-app', '-t', path.join('test_driver', 'failure.dart')], workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'), expectFailure: true, printOutput: false, @@ -200,23 +191,21 @@ Future _runTests({List options: const []}) async { await _verifyVersion(path.join(flutterRoot, 'version')); // Run tests. - await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'packages', - 'fuchsia_remote_debug_protocol'), options: options); + await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter')); + await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations')); + await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver')); + await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test')); + await _runFlutterTest(path.join(flutterRoot, 'packages', 'fuchsia_remote_debug_protocol')); await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools')); await _pubRunTest(path.join(flutterRoot, 'dev', 'bots')); - - await _runAllDartTests(path.join(flutterRoot, 'dev', 'devicelab'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'vitool'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'), options: options); - await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'), options: options); + await _pubRunTest(path.join(flutterRoot, 'dev', 'devicelab')); + await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests')); + await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'vitool')); + await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world')); + await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers')); + await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks')); + await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery')); + await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog')); print('${bold}DONE: All tests successful.$reset'); } @@ -256,7 +245,9 @@ Future _pubRunTest( String workingDirectory, { String testPath, }) { - final List args = ['run', 'test', '-j1', '-rexpanded']; + final List args = ['run', 'test', '-j1', '-rcompact']; + if (!hasColor) + args.add('--no-color'); if (testPath != null) args.add(testPath); final Map pubEnvironment = {}; @@ -393,21 +384,6 @@ Future _runFlutterTest(String workingDirectory, { ); } -Future _runAllDartTests(String workingDirectory, { - Map environment, - List options, -}) { - final List args = ['--preview-dart-2']; - if (options != null) { - args.addAll(options); - } - args.add(path.join('test', 'all.dart')); - return _runCommand(dart, args, - workingDirectory: workingDirectory, - environment: environment, - ); -} - Future _runFlutterAnalyze(String workingDirectory, { List options: const [] }) { diff --git a/dev/devicelab/test/all.dart b/dev/devicelab/test/all.dart deleted file mode 100644 index a6bc062e8a..0000000000 --- a/dev/devicelab/test/all.dart +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'adb_test.dart' as adb_test; -import 'manifest_test.dart' as manifest_test; -import 'run_test.dart' as run_test; - -void main() { - adb_test.main(); - manifest_test.main(); - run_test.main(); -} diff --git a/examples/flutter_gallery/test/smoke_test.dart b/examples/flutter_gallery/test/smoke_test.dart index 55e07098ac..7d9a3c63df 100644 --- a/examples/flutter_gallery/test/smoke_test.dart +++ b/examples/flutter_gallery/test/smoke_test.dart @@ -47,7 +47,6 @@ void verifyToStringOutput(String name, String route, String testString) { } Future smokeDemo(WidgetTester tester, GalleryDemo demo) async { - print(demo); // Don't use pumpUntilNoTransientCallbacks in this function, because some of // the smoketests have infinitely-running animations (e.g. the progress // indicators demo). diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index 9b3df7b915..4c98e2bbc1 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -128,14 +128,15 @@ class UpdatePackagesCommand extends FlutterCommand { if (checksum != pubspec.checksum.value) { // If the checksum doesn't match, they may have added or removed some dependencies. // we need to run update-packages to recapture the transitive deps. - printStatus( + printError( 'Warning: pubspec in ${directory.path} has invalid dependencies. ' 'Please run "flutter update-packages" --force-upgrade to update them correctly.' ); - } else { - // everything is correct in the pubspec. - printStatus('pubspec in ${directory.path} is up to date!'); - } + needsUpdate = true; + } else { + // everything is correct in the pubspec. + printTrace('pubspec in ${directory.path} is up to date!'); + } } if (needsUpdate) { throwToolExit( @@ -144,6 +145,7 @@ class UpdatePackagesCommand extends FlutterCommand { exitCode: 1, ); } + printStatus('All pubspecs were up to date.'); return; } diff --git a/packages/flutter_tools/lib/src/test/runner.dart b/packages/flutter_tools/lib/src/test/runner.dart index 4fbe8e0ca5..080566215e 100644 --- a/packages/flutter_tools/lib/src/test/runner.dart +++ b/packages/flutter_tools/lib/src/test/runner.dart @@ -43,16 +43,17 @@ Future runTests( // Compute the command-line arguments for package:test. final List testArgs = []; - if (!terminal.supportsColor) - testArgs.addAll(['--no-color', '-rexpanded']); + if (!terminal.supportsColor) { + testArgs.addAll(['--no-color']); + } if (machine) { testArgs.addAll(['-r', 'json']); + } else { + testArgs.addAll(['-r', 'compact']); } - if (enableObservatory) { - // (In particular, for collecting code coverage.) - + if (enableObservatory) { // (In particular, for collecting code coverage.) // Turn on concurrency, but just barely. This is a trade-off between running // too many tests such that they all time out, and too few tests such that // the tests overall take too much time. The current number is empirically diff --git a/packages/flutter_tools/test/android/android_sdk_test.dart b/packages/flutter_tools/test/android/android_sdk_test.dart index 34a7769459..6effc541f6 100644 --- a/packages/flutter_tools/test/android/android_sdk_test.dart +++ b/packages/flutter_tools/test/android/android_sdk_test.dart @@ -132,7 +132,6 @@ void main() { final AndroidSdk sdk = AndroidSdk.locateAndroidSdk(); expect(sdk.directory, realSdkDir); - print(AndroidNdk.explainMissingNdk(sdk.directory)); expect(sdk.ndk, isNotNull); expect(sdk.ndk.directory, realNdkDir); expect(sdk.ndk.compiler, realNdkCompiler);