Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 0db468f

Browse files
authored
Add instructions for getting code coverage in Android Studio (#51105)
small readme change, because for whatever reason we need to apply the comment from this hero robolectric/robolectric#3023 (comment) to make code coverage work [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent eb255c5 commit 0db468f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

shell/platform/android/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,12 @@ Android Studio:
215215
![Example](https://github.com/flutter/flutter/assets/168174/02fe0e6f-f0c4-47b2-8dae-9aa0b9520503)
216216
217217
At this point you should be able to open Java files in Android Studio and get
218-
code completion in the `io/flutter` folder (additional, undocumented work is
219-
required for `test/io/flutter`). For example, `FlutterJNI.java`:
218+
code completion in the `io/flutter` and `test/io/flutter` folders. For example, `FlutterJNI.java`:
220219
221220
![Example](https://github.com/flutter/flutter/assets/168174/387550d4-eab7-4097-9da3-7713a6ec4da7)
221+
222+
To get code coverage displayed in line: go to the test class you wish to run and
223+
1. Right click > Modify Run Configuration...,
224+
2. In the window that pops up click Modify options > Specify classes
225+
and packages (under "code coverage").
226+
3. In the new box that appears at the bottom of the window, click the + > Add package, and then add `io.flutter.*`.

0 commit comments

Comments
 (0)