From KitwarePublic
Jump to: navigation, search

To perform code coverage on CDash, you need to install xdebug as a module in your PHP installation. Once that is done you need to reconfigure PHP to automatically include two files: prepend_coverage.php and append_coverage.php. There are two ways to accomplish this.

Method 1: edit php.ini

edit the php.ini file, add these two lines, and restart apache:

auto_prepend_file =/path/to/CDashTesting/prepend_coverage.php
auto_append_file =/path/to/CDashTesting/build/append_coverage.php

Note that this method will cause all PHP files on your webserver to run through xdebug, causing a slight performance penalty.

Method 2: create a .htaccess file in CDash

This option is only available for computers using Apache for their web server.

Ensure that .htaccess files can be used on your host. To do so, you'll need to examine (and possibly edit) your host configuration file. On Ubuntu & Debian, this is typically


Inside this file, replace

   AllowOverride None


   AllowOverride All

Then create a file named .htaccess in your top level CDash source directory. Its contents should be as follows:

php_value auto_prepend_file "/path/to/CDashTesting/prepend_coverage.php"
php_value auto_append_file "/path/to/CDashTesting/build/append_coverage.php"

Pitfalls to avoid when performing coverage with xdebug

For coverage to work, a CMake newer than 5/25/2010 at 4:00 pm will be needed.

Using XAMPP 1.7 on Windows Vista/7 You might need a different version of XDebug: The version shipped with XAMPP causes the server to crash:!_development#Edit_PHP.INI_File