| 165 | You can apply the following procedure (for a Unix build) to build GDAL with coverage support : |
| 166 | * checkout GDAL SVN repository |
| 167 | * apply attached patch at the root at the GDAL tree : patch -p0 < coverage.patch |
| 168 | * configure GDAL : ./configure --without-libtool |
| 169 | * build GDAL : make |
| 170 | * run any command using GDAL : LD_LIBRARY_PATH=$PWD apps/gdalinfo test.tif |
| 171 | * generate a .info file from the collected data : lcov --directory . --capture --output-file gdal.info |
| 172 | * remove unrelevant info with the following attached program (filter_info.c : gcc filter_info.c -o filter_info) : ./filter_info < gdal.info > gdal_filtered.info |
| 173 | * generate the HTML report in the coverage_html directory : genhtml -o ./coverage_html --num-spaces 2 gdal_filtered.info |
| 174 | |
| 175 | If you want to generate a new coverage report, remove all .gcda files first (rm -f `find . -name *.gcda`) and redo the last 4 previous steps. |
| 176 | |
| 177 | Note : the coverage.patch is hackish and makes GDAL makefile lose some dependency rules. So if you modify a source file, make sure to remove libgdal.so before running make. |