Estimated hours taken: 10
Branches: main, release
Fix the monitors that were computing coverage rates in Morphine. The
problem was the following. In order to check that two successes and
one failure occur for a multi predicate, I was looking at two exits
and one fail; but this is wrong since, of course, the two exits can
be produced by different calls, and since all multi predicates ends
up with a fail event. To get it right, I need to associate the call
number to exit and fail events. To do that, I maintain at exit ports
the list of call numbers; when an exit event occurs, I consider it as
covered iff the current call number is in the list. On the contrary,
I consider a failure as covered at a fail port iff the current call
number is not in the list. This also holds for semidet and nondet
procedures.
extras/morphine/non-regression-tests/queens.exp:
Update the new expected outputs.
extras/morphine/non-regression-tests/queens.in:
Update the year of the copyrigth message.
extras/morphine/source/call_site_cov.in:
extras/morphine/source/pred_cov.in:
Change the code so that it does what it is supposed to do.
Also use a map instead of a list to store what has to be
covered for each procedure.
extras/morphine/source/generate_pred_cov.m:
extras/morphine/source/generate_call_site_cov.m:
extras/morphine/source/coverage_util.m:
Generate an initialize/1 predicate that uses map instead of lists.
extras/morphine/source/coverage.op:
Coverage monitors now output assoc lists.
tested), but I would like to commit it before I leave on
holidays. Any objection?
--
Estimated hours taken: 40
branches: main.
Add a scenario which provides commands that perform predicate and
call site coverage.
extras/morphine/source/generate_pred_cov.m:
(New file) Program that parses Mercury modules to
generate a monitor that performs predicate coverage.
extras/morphine/source/generate_call_site_cov.m:
(New file) Program that parses Mercury modules to generate
a monitor that performs call site coverage.
extras/morphine/source/coverage_util.m:
(New file) Common stuff to generate_pred_cov.m and
generate_call_site_cov.m
extras/morphine/source/pred_cov.in:
extras/morphine/source/call_site_cov.in:
(New files) Used to generate the call_site_cov and pred_cov
monitors.
extras/morphine/source/coverage.op:
(New file) New scenario that provides call_site_cov/2 and
pred_cov/2 commands, which perform the predicate and call
site coverage of a Mercury module.
extras/morphine/non-regression-tests/queens.in:
extras/morphine/non-regression-tests/queens.exp:
Add a test case for the pred_cov/2 and call_site_cov/2
commands.
extras/morphine/INSTALL-MORPHINE:
compile generate_call_site_cov.m and generate_pred_cov.m
modules when installing morphine.