All Manuals > LispWorks User Guide and Reference Manual > 38 The HCL Package

NextPrevUpTopContentsIndex

code-coverage-file-stats

Type
Summary

A structure containing code coverage statistics.

Package

hcl

Readers

code-coverage-file-stats-source-file

Pseudo-readers

code-coverage-file-stats-lambdas-count
code-coverage-file-stats-called
code-coverage-file-stats-fully-covered
code-coverage-file-stats-hidden-covered
code-coverage-file-stats-not-called
code-coverage-file-stats-partially-covered
code-coverage-file-stats-counters-count
code-coverage-file-stats-counters-executed
code-coverage-file-stats-counters-hidden

Description

Objects of type code-coverage-file-stats are created by code-coverage-data-generate-statistics, and are then accessed by the readers.

code-coverage-file-stats-source-file returns the truename of the source file. The pseudo-readers return integers counting "lambdas" in this file, where "lambda" here means a separate function object that was produced by the compiler. In most cases these correspond to pieces of code that you can see, like a function that results from cl:defun or cl:defmethod, or a lambda that appears in your code, but in some cases the compiler generates functions in a non-obvious way.

The pseudo-readers each have signature

pseudo-reader ccfs keyword => count

where ccfs is a code-coverage-file-stats object, and keyword specifies the kind of lambda. All lambdas belong to one of these four kinds:

:functions

Functions that are defined by cl:defun.

:macros

Macros and macro-like (for example cl:defsetf).

:one-shot

Load time lambdas that the compiler generates.

:lambdas

Other lambdas (including cl:defmethod).

In addition, the following three values of keyword can be used:

:all

All lambdas.

:runtime

:functions and :lambdas.

:non-runtime

:one-shot and :macros.

Each pseudo-reader returns the number of lambdas or counters in the file of the kind specified by the keyword. These are:

code-coverage-file-stats-lambdas-count

All lambdas.

code-coverage-file-stats-called

Lambdas that have been called.

code-coverage-file-stats-fully-covered

Lambdas which were fully covered, that is all of their counters are non-zero.

code-coverage-file-stats-hidden-covered

Lambdas where there are counters which are 0, but do not correspond to actual source code (result of macroexpansion).

code-coverage-file-stats-not-called

Lambdas that were not called at all.

code-coverage-file-stats-partially-covered

Lambdas that were partially covered, but part of the source did not execute.

code-coverage-file-stats-counters-count

All counters.

code-coverage-file-stats-counters-executed

Counters that executed (that is, they are not zero).

code-coverage-file-stats-counters-hidden

Counters which have not been executed and are hidden, that is not in the source (in a result of macroexpansion).

Notes
  1. The statistics are based on interpreting the counters as a binary switch of zero/non-zero. Negative counter values (which may occur if the code coverage data is a result of a subtraction operation such as subtract-code-coverage-data) are interpreted as "executed".
  2. The runtime/non-runtime distinction is intended to correspond to code that would run in the actual application (runtime) and code that is used only at compile-time or load-time.
Examples
code-coverage-file-stats-called code-coverage-file-stats
 :runtime
=>
lambda-count

where lambda-count is the number of lambdas in the file which are "runtime" and have been called.

See also

Code Coverage
code-coverage-data-generate-statistics


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex