?- show_coverage(run_tests)., this library
currently only shows some rough quality measure for test-suite. Later
versions should provide a report to the developer identifying which
clauses are covered, not covered and always failed.
One of the reasons to have tests is to simplify migrating code between Prolog implementations. Unfortunately creating a portable test-suite implies a poor integration into the development environment. Luckily, the specification of the test-system proposed here can be ported quite easily to most Prolog systems sufficiently compatible to SWI-Prolog to consider porting your application. Most important is to have support for term_expansion/2.
In the current system, test units are compiled into sub-modules of the module in which they appear. Few Prolog systems allow for sub-modules and therefore ports may have to fall-back to inject the code in the surrounding module. This implies that support predicates used inside the test unit should not conflict with predicates of the module being tested.
The directory of
be in the
library search-path. With PLUNITDIR replaced accordingly,
add the following into your
:- set_prolog_flag(language, iso). % for maximal compatibility library_directory('PLUNITDIR').
The current version runs under SICStus 3. Open issues:
- Some messages are unformatted because SICStus 3 reports all ISO
errors as instantiation errors.
plunit.pl. Both coverage analysis and the test generation wizard currently require SWI-Prolog.
normalis the same as