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)
  • Test assertions (for easier debugging of failed tests)
  • Support for testing input/output predicates
  • Predicate determinism testing
  • Benchmarking support
  • Approximate float comparison support
  • Test set and per test annotations
  • Testing automation script
  • TAP and xUnit test reports
  • Test set condition, setup, and cleanup goals
  • Per test condition, setup, and cleanup goals
  • Support for test subsets

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