This module allows executing test cases and analysing the coverage of the tested code. The test cases are the same as for the module runner. But contrary to the module runner test results are not collected by this module. Instead this module installs a debugger hook and collects a coverage map.The coverage map is stored by the following facts:
:- public cover_summary/1.
:- dynamic cover_summary/1.
:- public cover_source/2.
:- dynamic cover_source/2.
% cover_source(Source, OkNok)
:- public cover_predicate/4.
:- dynamic cover_predicate/4.
% cover_predicate(Fun, Arity, Source, OkNok)
:- public cover/5.
:- dynamic cover/5.
% cover(Fun, Arity, Source, Line, OkNok).
The debugger hook slows down the execution of test cases by a factor of 3-4. The collection is done in two phases. First the predicate tracker_batch/0 has to be called. Then the predicate analyze_batch/0 has to be called. The later predicate needs text/1 facts that designate the sources that should appear in the coverage map.
The following tracker predicates are provided: