This command is available on Sun-3 and Sun-4 systems only.
tcov produces a test coverage analysis and statement-by-statement profile 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 information 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 coverage 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 routines use gprof.1 or prof.1
The command:
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
The command:
example% tcov prog.c produces an annotated listing in file prog.tcov
The analyzed program must call exit.2v or return normally for the coverage information to be saved in the .d file.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97