TCOV(1) General Commands Manual TCOV(1)
tcov - construct test coverage analysis and statement-by-statement pro-
tcov [ -a ] [ -n ] srcfile...
This command is available on Sun-3 and Sun-4 systems only.
tcov produces a test coverage analysis and statement-by-statement pro-
file of a C or FORTRAN program. When a program in a file named file.c
or file.f is compiled with the -a option, a corresponding file.d file
is created. Each time the program is executed, test coverage informa-
tion is accumulated in file.d.
tcov takes source files as arguments. It reads the corresponding
file.d file and produces an annotated listing of the program with cov-
erage data 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: the profile produced includes only the number of times each
statement was executed, not execution times; to obtain times for rou-
tines use gprof(1) or prof(1).
-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 exe-
cuted statements and their execution counts.
example% cc -a -o prog prog.c
compiles with the -a option -- produces prog.d
The command: example% prog
executes the program `-' accumulates data in prog.d
example% tcov prog.c produces an annotated listing in file
file.c input C program file
file.f input FORTRAN program file
file.d input test coverage data file
file.tcov output test coverage analysis listing file
/usr/lib/bb_link.o entry and exit routines for test coverage analysis
cc(1V), gprof(1), prof(1), exit(2V)
premature end of file
Issued for routines containing no statements.
The analyzed program must call exit(2V) or return normally for the cov-
erage information to be saved in the .d file.
18 February 1988 TCOV(1)