TCOV(1) — USER COMMANDS
NAME
tcov − construct test coverage analysis and statement-by-statement profile
SYNOPSIS
tcov [ −a ] [ −n ] file.c ...
DESCRIPTION
Tcov produces a test coverage analysis and statement-by-statement profile of a C program. The coverage data for routines contained in a file named file.c is taken from the corresponding file.d produced by running the C compiler cc(1) with the −a option. An annotated listing of the program with coverage data is placed in file.tcov. Each straight-line segment of code (or each line if the −a option to tcov is specified) is prefixed with the number of times it has been executed; lines which have not been executed are prefixed with #####.
Note that the profile produced includes only the number of times each statement was executed, not execution times; to obtain times for routines use gprof(1) or prof(1).
Test coverage data from several runs will accumulate in the .d files.
OPTIONS
−a display an execution count for each statement; if −a is not specified, an execution count is displayed only for the first statement of each straight-line segment of code.
−n display table of the line numbers of the n most frequently executed statements and their execution counts.
SEE ALSO
FILES
file.cinput C program file
file.dinput test coverage data file
file.tcovoutput test coverage analysis listing file
/usr/bin/countpreprocessor for test coverage analysis
/usr/lib/bb_link.ostartoff and exit routines for test coverage analysis
BUGS
The analyzed program must call exit(2) or return normally for the coverage information to be saved in the .d file.
‘Premature end of file’ message for routine containing no statements.
Sun Release 2.0 — Last change: 17 September 1984