Running the SWI-Prolog unit tests from swipl

I can invoke the unit tests from the shell using

cmake ..
ninja
ctest

Is it possible to invoke these tests easily from swipl, that is,

cmake ..
ninja
src/swipl
?- ctest. % or something equivalent 

I was actually wondering whether it is possible to run the built-in unit tests from the swipl prompt, that is, from ?-, not from the bash $. Similar to ?- check_installation.

The trick is to configure using -DINSTALL_TESTS=ON. After that, the installed version can be tested using

?- test_installation.

This is used in the Debian test cycle and is also intended to allow testing cross-compiled versions. It does imply that the installed system gets bigger.

edit it installs a test directory holding all test scripts and data. It is about 13Mb in size.

1 Like