Re: unit tests and related matters

Michael Hendricks <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFHuXubZRCqpOnzEwRan_d9PTMQY4yFt45eYDO7ZuVNFErO=tQ@mail.gmail.com>
On Sat, Jul 20, 2013 at 3:09 PM, Ross Boylan <[email protected]> wrote:

> What's the best way to do unit tests?
>

After upgrading to a more recent SWI-Prolog version, as Nicos suggested,
you might try library(tap), available as a pack.  That library is my
personal preference for writing unit tests in SWI-Prolog.  Because it
implements the Test Anything Protocol, there's a wide set of tools for
running and analyzing tests.  A few favorite features: interactive HTML
test results <http://www.spurkis.org/TAP-Formatter-HTML/test-output.html>,
running tests in parallel (especially helpful for large test suites),
supported by several
languages<http://testanything.org/wiki/index.php/TAP_Producers>(helpful
on polyglot projects).

The library's documentation is at http://www.swi-prolog.org/pack/list?p=tap

With SWI-Prolog after v6.3, you can install it with

?- pack_install(tap).

-- 
Michael




>
> Searching led to http://www.swi-prolog.org/pldoc/package/plunit.html, but
> it
> doesn't seem to come with my installation or be available as a Debian
> package.
> I'm using Debian wheezy amd64, which has SWI Prolog 5.10.4.
>
> Eventually I  found http://www.swi-prolog.org/git/packages/plunit.git.
>
> If that is appropriate to use, should I go with the current version, or the
> one tagged for V5.10.4?
>
> I assume I then need to put that in an appropriate spot, probably compile
> it,
> and make sure prolog knows how to find it.  Any tips on that would be
> great,
> otherwise I can probably figure it out from the fine manual.
>
> It would be nice if this kind of stuff were more obvious to  the
> uninitiate.
> Possibilities include
> *on the front page "a rich set of contributed modules" with a link (yes I
> know
> the contrib link is on the left; that's how I eventually found them).
> *A FAQ entry about how to locate, get and use contributed libraries, and
> possibly other stuff on git.
> * Expand http://www.swi-prolog.org/git.html to include 3rd party
> libraries.
> *  http://www.swi-prolog.org/pldoc/package/plunit.html describes how to
> get
> the library, or at least links to the software.
>
> Thanks.
> Ross Boylan
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.