Upgrade to the most recent test package. (#11526)

Also, add tests to verify that our coverage is actually being tested!
This commit is contained in:
Ian Hickson
2017-08-04 16:33:38 -07:00
committed by GitHub
parent 1e53d3206b
commit db88414131
8 changed files with 68 additions and 19 deletions

View File

@@ -1,4 +1,5 @@
The files in this directory are used as part of tests in the
`flutter_tools` package. They are here because here these tests need a
`flutter_tools` package. Some are here because here these tests need a
`pubspec.yaml` that references the flutter framework (which is
intentionally not true of the `flutter_tools` package).
intentionally not true of the `flutter_tools` package). Others are
here mostly out of peer pressure.

View File

@@ -0,0 +1,9 @@
// Copyright 2017 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:test/test.dart';
void main() {
test('trivial', () { });
}

View File

@@ -145,9 +145,23 @@ Future<Null> _runCoverage() async {
return;
}
final File coverageFile = new File(path.join(flutterRoot, 'packages', 'flutter', 'coverage', 'lcov.info'));
if (!coverageFile.existsSync()) {
print('${red}Coverage file not found.$reset');
print('Expected to find: ${coverageFile.absolute}');
print('This file is normally obtained by running `flutter update-packages`.');
exit(1);
}
coverageFile.deleteSync();
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'),
options: const <String>['--coverage'],
);
if (!coverageFile.existsSync()) {
print('${red}Coverage file not found.$reset');
print('Expected to find: ${coverageFile.absolute}');
print('This file should have been generated by the `flutter test --coverage` script, but was not.');
exit(1);
}
print('${bold}DONE: Coverage collection successful.$reset');
}

View File

@@ -20,4 +20,4 @@ dependencies:
dev_dependencies:
# See packages/flutter_test/pubspec.yaml for why we're pinning this version.
test: 0.12.21
test: 0.12.24+2