yum install perl-devel
yum install perl-Digest-MD5
yum install perl-GD
Download and install lcov
rpm -U lcov-1.13-1.el7.noarch.rpm
Run TestConfigure and make
Use the --enable-coverage configure flag
make -j 4
Run make check
make check -i
A file with .gcno extension is created for each source file and another with .gcda extension is generated when we run the tests.
A folder named 'coverage' is generated along with the index.html file and other required data to display the coverage information. The HTML page will show a summary of the coverage for each folder and recursively for each file and then for each line.
A .gcov and .gcov.out file is created for each source file which contains the coverage information.
This resets the execution count by removing all the .gcda files generated.
<file>.gcov.outThis list out the details for each function in the corresponding source file. An example output for a function is shown below:
Function 'heap_sync' Lines executed:100.00% of 10 Branches executed:100.00% of 4 Taken at least once:75.00% of 4 Calls executed:100.00% of 6
<file>.gcovThis displays the original file entirely along with the line number and the count of the number of times each line was executed during the test run. Lines which were never executed are marked with hashes ‘######’ and '-' indicated that the line is not executable.
-: 9258: /* main heap */ 50: 9259: FlushRelationBuffers(rel); call 0 returned 100%
. <more lines>
#####: 9283: Page page = (Page) pagedata;
-: 9284: OffsetNumber off;
#####: 9286: mask_page_lsn_and_checksum(page);
call 0 never executed
The home page:
This lists out all the sub directory along with their coverage data.
Per directory info:
On clicking a particular directory, we get the coverage info of each file in the selected directory.
Select a file:
This gives out the per line hit count of the selected file. The one highlighted in blue are hit and those in red are never executed during the test run.