make flutter upgrade less verbose (#3237)

* more terse flutter upgrade

* fix an issue when updating and the engine update code has changed

* call flutter precache; add a --no-color hidden option

* fix a lint related to getters/setters
This commit is contained in:
Devon Carew
2016-04-11 11:17:09 -07:00
parent 47f5c6f2e0
commit 2a33e3f0c0
7 changed files with 72 additions and 20 deletions

View File

@@ -26,6 +26,7 @@ import 'run_test.dart' as run_test;
import 'service_protocol_test.dart' as service_protocol_test;
import 'stop_test.dart' as stop_test;
import 'trace_test.dart' as trace_test;
import 'upgrade_test.dart' as upgrade_test;
void main() {
adb_test.main();
@@ -47,4 +48,5 @@ void main() {
service_protocol_test.main();
stop_test.main();
trace_test.main();
upgrade_test.main();
}

View File

@@ -0,0 +1,28 @@
// 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 'package:flutter_tools/src/commands/upgrade.dart';
import 'package:test/test.dart';
void main() {
group('upgrade', () {
bool _match(String line) => UpgradeCommand.matchesGitLine(line);
test('regex match', () {
expect(_match(' .../material_gallery/lib/demo/buttons_demo.dart | 10 +--'), true);
expect(_match(' dev/benchmarks/complex_layout/lib/main.dart | 24 +-'), true);
expect(_match(' rename {packages/flutter/doc => dev/docs}/styles.html (92%)'), true);
expect(_match(' delete mode 100644 doc/index.html'), true);
expect(_match(' create mode 100644 examples/material_gallery/lib/gallery/demo.dart'), true);
expect(_match('Fast-forward'), true);
});
test('regex doesn\'t match', () {
expect(_match('Updating 79cfe1e..5046107'), false);
expect(_match('229 files changed, 6179 insertions(+), 3065 deletions(-)'), false);
});
});
}