
plunit.pl -- Unit TestingUnit testing environment for SWI-Prolog and SICStus Prolog. For usage, please visit https://www.swi-prolog.org/pldoc/package/plunit.
set_test_options(+Options)never, always, normal (only if not optimised)manual, make
or make(all).tty or log. tty uses terminal
control to overwrite successful tests, allowing the
user to see the currently running tests and output
from failed tests. This is the default of the output
is a tty. log prints a full log of the executed
tests and their result and is intended for non-interactive
usage.always, emit all output as it is produced, if never,
suppress all output and if on_failure, emit the output
if the test fails.occurs_check flag during
testing.true (default =false), cleanup report at the end
of run_tests/1. Used to improve cooperation with
memory debuggers such as dmalloc.
loading_tests[private]
begin_tests(+UnitName:atom) is det
begin_tests(+UnitName:atom, Options) is detend_tests(UnitName).
end_tests(+Name) is det
make_unit_module(+Name, -ModuleName) is det[private]
unit_module(+Name, -ModuleName) is det[private]
expand_test(+Name, +Options, +Body, -Clause) is det[private]test(Name, Options) :- Body into a clause for
'unit test'/4 and 'unit body'/2.
expand(+Term, -Clauses) is semidet[private]
valid_options(:Pred, +Options) is det[private]
test_option(+Option) is semidet[private]test(Name, Options).
test_option(+Option) is semidet[private]begin_tests(Name,
Options).
reify_tmo(:Goal, -Result, +Options) is det[private]
reify(:Goal, -Result) is det[private]true, false or
throw(E).
capture_output(:Goal, -Output) is semidet[private]
capture_output(:Goal, -Output, +Options) is semidet[private]
got_messages(:Goal, -Result)[private]
run_tests is semidet
run_tests(+TestSet) is semidet
run_tests(+TestSet, +Options) is semidetThe predicate run_tests/2 is synchronized. Concurrent testing may be achieved using the relevant options. See set_test_options/1. Options are passed to set_test_options/1. In addition the following options are processed:
report_and_cleanup(+Ref, +Time, +Options)[private]
runnable_tests(+Spec, -Plan) is det[private]Unit:Tests lists, where
blocked tests or tests whose condition fails are already removed.
Each test in Tests is a term @(Test,Line), which serves as a
unique identifier of the test.
count_tests(+Units0, -Units, -Count) is det[private]forall(Generator, Test) counts
as a single test. During the execution, the concrete tests of the
forall are considered "sub tests".
run_unit(+Unit) is det[private]
run_tests_in_files(+Files:list) is det[private]
make_run_tests(+Files)[private]
run_test(+Unit, +Test) is det[private]
run_test(+Unit, +Name, +Line, +UnitOptions, +Options, +Body)[private]forall(Generator, Test)
run_test_once6(+Unit, +Name, +Progress, +Line, +UnitOptions, +Options, +Body)[private]timeout and occurs_check option (Global -> Unit -> Test).
run_test_once(+Unit, +Name, +Progress, +Line, +Options, +Body)[private]
report_result(+Result, +Progress, +Output, +Options) is det[private]
run_test_6(+Unit, +Name, +Line, +Options, :Body, -Result) is det[private]time_limit_exceeded(Limit)cmp_error(Cmp, E)wrong_answer(Cmp)wrong_error(Expect, E)wrong_answer(Expected, Bindings)
run_test_7(+Unit, +Name, +Line, +Options, :Body, -Result) is det[private]
result_vars(+Expected, -Vars) is det[private]v(V1, ...) containing all variables at the left
side of the comparison operator on Expected.
nondet_compare(+Expected, +Bindings, +Unit, +Name, +Line) is semidet[private]
cmp(+CmpTerm, -Left, -Op, -Right) is det[private]
call_det(:Goal, -Det) is nondet[private]true if Goal left
no choicepoints and false otherwise.
match_error(+Expected, +Received) is semidet[private]
setup(+Module, +Context, +Options) is semidet[private]
condition(+Module, +Context, +Options) is semidet[private]
call_ex(+Module, +Goal)[private]
cleanup(+Module, +Options) is det[private]
failure(+Unit, +Name, +Progress, +Line, +How, +Time, +Output, +Options) is det[private]
assert_cyclic(+Term) is det[private]
setup_jobs(+Count) is det[private]
job_wait(?Unit) is det[private]
begin_test(+Unit, +Test, +Line, +Progress) is det[private]
end_test(+Unit, +Test, +Line, +Progress) is det[private]silent message:
plunit(begin(Unit:Test, File:Line, Progress))plunit(end(Unit:Test, File:Line, Progress))
running_tests is det
current_test(?Unit, ?Test, ?Line, ?Body, ?Options) is nondet
current_test_unit(?Unit, ?Options) is nondet
test_summary(?Unit, -Summary) is det[private]
report(+Time, +Options) is det[private]
test_report(+What) is detfixme for What.
unit_file(+Unit, -File) is det[private]
load_test_files(+Options) is det
info(+Term)[private]print_message(Level, Term), where Level is one of silent or
informational (default).
progress(+UnitTest, +Progress, +Result, +Time) is det[private]forall(Gen,Test) set. Mapped
to forall(FTotal, FFailed)
test_name_summary(+Term, +MaxLen, -Summary) is det[private]
progress_string(+Progress, -S) is det[private]
progress_tag(+Status, -Tag, -Keep, -Style) is det[private]
jobs_redraw is det[private]
job_format(+Style, +Fmt, +Args) is det[private]
job_format(+Job, +Style, +Fmt, +Args, +Save) is det[private]
job_finish(+Style, +Fmt, +Args) is det[private]
job_finish(+Job, +Style, +Fmt, +Args) is det[private]tty format, which reuses the current
output line if the test is successful.
user:message_hook(+Severity, +Message, +Lines) is semidet[multifile]