Unverified Commit afb6b955 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tool] fix incorrect coverage file generation (#71726)

parent e5f2236a
...@@ -251,7 +251,8 @@ class TestCommand extends FlutterCommand { ...@@ -251,7 +251,8 @@ class TestCommand extends FlutterCommand {
verbose: !machine, verbose: !machine,
libraryPredicate: (String libraryName) => libraryName.contains(projectName), libraryPredicate: (String libraryName) => libraryName.contains(projectName),
// TODO(jonahwilliams): file bug for incorrect URI handling on windows // TODO(jonahwilliams): file bug for incorrect URI handling on windows
packagesPath: globals.fs.path.absolute('.packages'), packagesPath: globals.fs.file(buildInfo.packagesPath)
.parent.parent.childFile('.packages').path
); );
} }
......
...@@ -117,7 +117,6 @@ class CoverageCollector extends TestWatcher { ...@@ -117,7 +117,6 @@ class CoverageCollector extends TestWatcher {
Future<String> finalizeCoverage({ Future<String> finalizeCoverage({
coverage.Formatter formatter, coverage.Formatter formatter,
Directory coverageDirectory, Directory coverageDirectory,
String packagesPath,
}) async { }) async {
if (_globalHitmap == null) { if (_globalHitmap == null) {
return null; return null;
......
...@@ -29,6 +29,9 @@ void main() { ...@@ -29,6 +29,9 @@ void main() {
await flutter.test(coverage: true); await flutter.test(coverage: true);
await flutter.done; await flutter.done;
expect(tempDir.childDirectory('coverage').childFile('lcov.info'), exists); final File lcovFile = tempDir.childDirectory('coverage').childFile('lcov.info');
expect(lcovFile, exists);
expect(lcovFile.readAsStringSync(), contains('main.dart')); // either 'SF:lib/main.dart or SF:lib\\main.dart
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment