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

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 Functions

Summary

Functions to access varous code coverage statistics.

Package

hcl

Signatures

code-coverage-file-stats-lambdas-count ccfs keyword => count

code-coverage-file-stats-called ccfs keyword => count

code-coverage-file-stats-fully-covered ccfs keyword => count

code-coverage-file-stats-hidden-covered ccfs keyword => count

code-coverage-file-stats-not-called ccfs keyword => count

code-coverage-file-stats-partially-covered ccfs keyword => count

code-coverage-file-stats-counters-count ccfs keyword => count

code-coverage-file-stats-counters-executed ccfs keyword => count

code-coverage-file-stats-counters-hidden ccfs keyword => count

Arguments
ccfs
keyword
One of :functions, :macros, :one-shot, :lambdas, :all, :runtime or :non-runtime.
Values
count
An integer.
Description

These functions return integers counting "lambdas" in the file associated with ccfs, 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.

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 function returns the number of lambdas or counters of the kind specified by keyword in the file associated with ccfs. 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 run time/non-run time distinction is intended to correspond to code that would run in the actual application (run time) 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 "run time" and have been called.

See also

10 Code Coverage
code-coverage-data-generate-statistics
code-coverage-file-stats


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35