Testing tool

Logtalk testing tool, lgtunit, can be used to test both Logtalk and Prolog code and provides an extensive set of features including:

  • Multiple test dialects
  • User-defined test dialects
  • QuickCheck support
  • Code coverage reports (at the predicate clause level; supports links to selected source code hosting providers)
  • Test assertions (for easier debugging of failed tests)
  • Support for testing input/output predicates
  • Support for suppressing irrelevant text/binary output by the code under testing
  • Predicate determinism testing
  • Benchmarking support
  • Approximate float comparison support
  • Test set and per test annotations
  • Parametrised unit tests
  • Testing automation script (supports CI servers)
  • TAP and xUnit test reports
  • Test set condition, setup, and cleanup goals
  • Per test condition, setup, and cleanup goals
  • Support for test subsets (with generation of a single code coverage report)
  • Make tool integration

A code coverage report example (for the diagrams tool): https://logtalk.org/diagrams/coverage_report.html

An example of using this tool for testing Prolog predicates (Prolog standards conformance suite): https://github.com/LogtalkDotOrg/logtalk3/tree/master/tests/prolog

For details on the lgtunit tool, see https://github.com/LogtalkDotOrg/logtalk3/blob/master/tools/lgtunit/NOTES.md

For details on the testing automation script, see https://logtalk.org/man/logtalk_tester.html