Library coverage analysis for x-bin-profile instrumented code.
cov-word-sizeReturn the size of a machine word on this engine, in bytes.
Returns: INTEGER — Bytes in a machine word, 8 or 4
Examples:
(import x/tool/cov cov-word-size) (List includes? (cov-word-size) (list 4 8)) => #tcov-flagsReturn the flags word of an object’s header.
Returns: INTEGER — The object’s flags word, or 0 for nil
Examples:
(import x/tool/cov cov-flags) (cov-flags ()) => 0cov-covered?Test whether an object was marked as evaluated by x-bin-profile.
Returns: BOOL — True if object was evaluated (FLAG_2 set)
cov-cons?Test whether an object is a cell a body walk can step through.
Returns: BOOL — True if x is a pair, a list cell or an engine-built spine cell
Examples:
(import x/tool/cov cov-cons?) (cov-cons? (list 1)) => #t
(import x/tool/cov cov-cons?) (cov-cons? 5) => #fcov-bodyReturn the body forms of a procedure or an operative.
Returns: LIST — The body forms, or nil when there are none
Examples:
(import x/tool/cov cov-body) (cov-body (fn (_ x) (+ x 1))) => (('+ 'x 1))
(import x/tool/cov cov-body) (cov-body (op (a) e a)) => ('a)cov-count-treeCount covered and total AST nodes in a tree.
Returns: LIST — (covered total) pair
Examples:
(import x/tool/cov cov-count-tree) (first (rest (cov-count-tree (list 1 2) 0))) => 2cov-check-fnCheck coverage for a single function.
Returns: LIST — (name covered total) or nil
Examples:
(import x/tool/cov cov-check-fn) (first (cov-check-fn 'inc (fn (_ x) (+ x 1)) #f)) => 'inccov-check-classCheck coverage of every method a class defines itself.
Returns: LIST — List of (name covered total) rows (empty in TSV mode)
Examples:
(import x/tool/cov cov-check-class) (List includes? "Iter/next" (List map first (cov-check-class 'Iter Iter #f))) => #tcov-walkWalk an environment alist checking coverage on each procedure and class.
cov-skip-to-librarySkip past test definitions to the library boundary marker.
Returns: LIST — Alist from library boundary marker onward
Examples:
(import x/tool/cov cov-skip-to-library) (cov-skip-to-library (list (pair 'a 1) (pair '%cov-library-end 0) (pair 'b 2))) => (('b . 2))