Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1V)

prof(1)

gprof(1)

TCOV(1)  —  USER COMMANDS

NAME

tcov − construct test coverage analysis and statement-by-statement profile

SYNOPSIS

tcov [ −a ] [ −n ] srcfile ... 

DESCRIPTION

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 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).

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. 

EXAMPLES

sun% cc -a -o prog prog.cCompile with the -a option — produces prog.d
sun% progExecute the program — accumulates data in prog.d
sun% tcov prog.cProduces an annotated listing in file prog.tcov

SEE ALSO

cc(1V), prof(1), gprof(1)

FILES

file.cinput C program file
file.finput FORTRAN program file
file.dinput test coverage data file
file.tcovoutput test coverage analysis listing file
/usr/bin/countpreprocessor for test coverage analysis for C program
/usr/lib/bb_link.oentry 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. 

‘A premature end of file’ message is issued for routines containing no statements. 

Sun Release 3.2  —  Last change: 24 March 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026