Empty Code Coverage Report after Running Unit Tests In NetBeans

NetBeans has a nice code coverage-feature, but I experienced the problem that one machine I could get code coverage reports, but not on another machine. The configuration of both machines was the same: same Windows-version (Windows 7), same PHP-version (5.4.0), had the same version of XDebug (a requirement for having code coverage). I checked and changed some security settings on folders like the Temp-folder of PHP, Windows, XDebug, etc., but nothing worked. In the end I found out that it’s caused by a difference in the installation-folder of NetBeans.

On the first PC (were Code Coverage was working well) the installation-folder of NetBeans and the source code were located on the same drive, while on the second PC the installation-folder of NetBeans and the source code were on different drives.

Seems like a real bug in NetBeans…

However, you can still get nice code coverage results in a HTML-format by running  your tests from the command line.

No Code Coverage Report

No Code Coverage Report

Code Coverage Report Generated

Code Coverage Report Generated because NetBeans and the source code are on the same drive

One thought on “Empty Code Coverage Report after Running Unit Tests In NetBeans

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.