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:
@@ -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.
|
||||
|
||||
9
dev/automated_tests/flutter_test/trivial_test.dart
Normal file
9
dev/automated_tests/flutter_test/trivial_test.dart
Normal 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', () { });
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user