


TCOV(1)                  USER COMMANDS                    TCOV(1)



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

SYNOPSIS
     tcov [ -a ] [ -_n ] _s_r_c_f_i_l_e...

AVAILABILITY
     This command is available on Sun-3 and Sun-4 systems only.

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 _f_i_l_e.c or _f_i_l_e.f is  compiled  with  the  -a
     option,  a  corresponding _f_i_l_e.d file is created.  Each time
     the program is executed, test coverage information is  accu-
     mulated in _f_i_l_e.d.

     tcov  takes  source  files  as  arguments.   It  reads   the
     corresponding  _f_i_l_e.d file and produces an annotated listing
     of the  program  with  coverage  data  in  _f_i_l_e.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).

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  fre-
          quently executed statements and their execution counts.

EXAMPLES
     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:




Sun Release 4.1   Last change: 18 February 1988                 1






TCOV(1)                  USER COMMANDS                    TCOV(1)



          example% tcov prog.c produces an annotated  listing  in
          file prog.tcov

FILES
     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  cover-
                         age analysis
SEE ALSO
     cc(1V), gprof(1), prof(1), exit(2V)
DIAGNOSTICS
     premature end of file
          Issued for routines containing no statements.
BUGS
     The analyzed program must call exit(2V) or  return  normally
     for the coverage information to be saved in the ._d file.




































Sun Release 4.1   Last change: 18 February 1988                 2



