jeff @ dallien.net
March 14, 2009 05:46
Only a short update to the chain tonight because its getting late.
Before starting on the Prolog code for the prologblog.com site, I wanted to see if anyone in the Prolog community had documented how to do Test Driven Development (TDD) or Behavior Driven Development (BDD) in Prolog. I couldn’t even find some discussion on the subject let alone a how-to or tool set. For now, I will be on my own and figuring it out as I go.
The testing framework included with SWI-Prolog is called PlUnit. The Ubuntu SWI packages caused me to waste some more time today, as they don’t seem to include PlUnit, despite it being a package normally distributed with SWI. To use it, I had to get the current version directly from the SWI git respository. I kept the Ubuntu package-installed version of SWI and was able to manually install PlUnit next to it. Here are the steps for doing that.
git clone git://prolog.cs.vu.nl/home/pl/git/pl.git
cd pl/packages/plunit autoconf ./configure sudo make install
Note that there is no actual ‘make’ step. There is nothing to build, the files just need to be copied into the correct location.
To check that it was installed properly, one can run the files from the PlUnit examples directory.
cd pl/packages/plunit/examples/ # in the cloned git repo swipl -g "[simple],run_tests,halt." % simple compiled into ex_simple 0.01 sec, 108,664 bytes % PL-Unit: lists ........ done % All 8 tests passed
nicholas a. evans on March 16, 2009 9:50AM
Jeff Dallien on March 16, 2009 2:07PM
john on August 16, 2010 3:28AM
DaveE on June 02, 2011 11:16AM
DaveE on June 04, 2011 9:18AM