Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "doctest"

Title:Doctests using PlDoc and PlUnit
Rating:Not rated. Create the first rating!
Latest version:1.3.2
SHA1 sum:19d8739c65bb6b645a8001aef4c200c636e69a09
Author:Sylvain Soliman <Sylvain.Soliman@inria.fr>
Home page:https://gitlab.inria.fr/soliman/doctest/
Download URL:https://soliman.gitlabpages.inria.fr/doctest/doctest-*.zip

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
1.0.389e2463ec0d35b0ef3f04b1dc1803c565dc2cf434https://gitlab.inria.fr/soliman/doctest/-/archive/1.0.3/doctest-1.0.3.zip
1.1.34e5f7b2b08b41e2cdd0eb3dffa49e0d8d342100d3https://soliman.gitlabpages.inria.fr/doctest/doctest-1.1.3.zip
1.1.59ee9c64ce3989879abef96ff833901f2c3e23f072https://soliman.gitlabpages.inria.fr/doctest/doctest-1.1.5.zip
1.1.6db6de8c2d1bf55c7978ba5de43da3f1aa16acd2a4https://soliman.gitlabpages.inria.fr/doctest/doctest-1.1.6.zip
1.1.89d373e69ef86a98a7a509d198920ab9d11f550f02https://soliman.gitlabpages.inria.fr/doctest/doctest-1.1.8.zip
1.1.91b77895cfbd1d3ecc8d8654a11ad11b4738dbd652https://soliman.gitlabpages.inria.fr/doctest/doctest-1.1.9.zip
1.2.0d594e6bbaaea656e46087301c39f2956622e94672https://soliman.gitlabpages.inria.fr/doctest/doctest-1.2.0.zip
1.2.1cf3cbf221b9b771ac6e8abf11db3769e721fef601https://soliman.gitlabpages.inria.fr/doctest/doctest-1.2.1.zip
1.2.27ad602501a76dabd90ba878945c7f78c7ab67be81https://soliman.gitlabpages.inria.fr/doctest/doctest-1.2.2.zip
1.2.3e2be591330100fcdf3e36f44bb80918772421a424https://soliman.gitlabpages.inria.fr/doctest/doctest-1.2.3.zip
1.2.69892fc3589d72a696252f3ed96d65fb2e41083173https://soliman.gitlabpages.inria.fr/doctest/doctest-1.2.6.zip
1.2.78e221aacec5500841a984ba6aca86ab6dbd52adf1https://soliman.gitlabpages.inria.fr/doctest/doctest-1.2.7.zip
1.3.0787957faa87ea60d035f78c1ca0b285eac5f8db33https://soliman.gitlabpages.inria.fr/doctest/doctest-1.3.0.zip
1.3.123fd8870e0da1d8587ad82ffdeae8544b67f9c823https://soliman.gitlabpages.inria.fr/doctest/doctest-1.3.1.zip
1.3.219d8739c65bb6b645a8001aef4c200c636e69a093https://soliman.gitlabpages.inria.fr/doctest/doctest-1.3.2.zip

Doctest

![Latest release](https://gitlab.inria.fr/soliman/doctest/-/releases) ![Build Status](https://gitlab.inria.fr/soliman/doctest/-/pipelines)

Features

Generate PlUnit tests from queries in the PlDoc documentation of your module.

Be careful, this uses (and will run) the queries only (identified by ?- ) and not the documented answers (it will instead identify all answers/errors/etc. thanks to the test_wizard library) unless you use the parse_output(true) option. However that option currently will not properly recognize exception messages…

In all cases, if your queries call use_module, or print some output via write they will probably crash the parser. To avoid this, use indented code blocks, these will be safely ignored.

The current handling of errors is… work in progress ;)

Install

swipl pack install doctest

Usage

?- use_module(library(doctest)).
?- gen_doctests('input.pl', [outfile('output.plt')]).

You can access this package's PlDoc at https://soliman.gitlabpages.inria.fr/doctest/prolog/doctest.html

Contents of pack "doctest"

Pack contains 8 files holding a total of 11.3K bytes.