|
Tcov is a source code coverage analysis and statement-by-statement profiling tool for software written in Fortran, C and C++. Tcov generates exact counts of the number of times each statement in a program is executed and annotates source code to add instrumentation. It is a standard utility, provided free of cost with Sun Studio software under Sun Studio product license.〔(【引用サイトリンク】title=profiling programs with tcov )〕 The tcov utility gives information on how often a program executes segments of code. It produces a copy of the source file, annotated with execution frequencies. The code can be annotated at the basic block level or the source line level. As the statements in a basic block are executed the same number of times, a count of basic block executions equals number of times each statement in the block is executed.〔(【引用サイトリンク】title=Definition of basic block of code states that basic block has only one entry and only one exit point, essentially implying the statement. )〕 The tcov utility does not produce any time-based data. == Description == tcov produces a test coverage analysis of a compiled program. tcov takes source files as arguments and produces an annotated source listing. Each basic block of code (or each line if the particular option to tcov is specified) is prefixed with the number of times it has been executed; lines that have not been executed are prefixed with "#####". The tcov utility also places a summary at the end of the annotated program listing. The statistics for the most frequently executed basic blocks are listed in order of execution frequency. The line number is the number of the first line in the block. There are two implementations of tcov: *Old Style coverage analysis:〔(【引用サイトリンク】title=Original Tcov statement-by-statement analysis )〕 In this implementation, also known as tcov original, the compiler creates a coverage data file with the suffix .d for each object file. When program completes, the coverage data files are updated. *New Style coverage analysis:〔(【引用サイトリンク】title=Enhanced Tcov statement-by-statement analysis )〕 In this implementation, also known as tcov enhanced, no additional files are created at compile time. Instead, directory is created to store the profile data, and a single coverage data file called tcovd is created in that directory. Enhanced coverage analysis overcomes some of the shortcomings of the original analysis tool, such as:〔(【引用サイトリンク】title=Improved features of tcov enhanced over tcov original )〕 *Provides more complete support for C++. *Supports code found in #include header files and corrects a flaw that obscured coverage numbers for template classes and functions. *More efficient runtime than the original tcov runtime. *Supported for all the platforms that the compilers support. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Tcov」の詳細全文を読む スポンサード リンク
|