1
votes

I'm coming from Eclipse, where code coverage is very conveniently displayed in the code as well as a table when running JUnit tests.

In IntelliJ, I thus far have no idea how to get this working, and some of the things that I have tried seem to differ from the manual.

I have a suite of test cases, and try to run them using "Run with Coverage". What I am used to from Eclipse is that after the test run, a coverage report is shown and that the covered lines in the code are displayed in green, and uncovered lines are displayed in red.

However, this does not happen. No coverage report is shown, and no lines are highlighted. This differs from the behaviour described in https://www.jetbrains.com/help/idea/running-test-with-coverage.html

What do I have to do in order to have coverage data displayed both in code and as a statistics in InetlliJ?


EDIT: Added test run configuration Test Run Configuration


EDIT 2: For reference, this is how my Ceal-Delve project looks like when I run the tests in Eclipse. I would expect that IntelliJ also supports code coverage like this. At the very least I have found images, documentations and settings that all imply that something like this should also work in IntelliJ. Eclipse Code Coverage Sample

1

1 Answers

1
votes

It depends on your project structure. For example, for maven project it will work automatically.

Check you Run/Edit Configurations settings window:

enter image description here