4 Running the test-suite
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • Prolog Unit Tests
        • Running the test-suite
          • Running the test suite from Prolog
            • run_tests/0
            • run_tests/1
          • Running the test suite from the command line

4.1 Running the test suite from Prolog

To run tests from the Prolog prompt, first load the program and then run run_tests/0 or run_tests(+Unit).

run_tests
Run all test-units.
run_tests(+Spec)
Run only the specified tests. Spec can be a list to run multiple tests. A single specification is either the name of a test unit or a term <Unit>:<Tests>, running only the specified test. <Tests> is either the name of a test or a list of names. Running particular tests is particularly useful for tracing a test:6Unfortunately the body of the test is called through meta-calling, so it cannot be traced. The called user-code can be traced normally though.
?- gtrace, run_tests(lists:member).

To identify nonterminating tests, interrupt the looping process with Control-C. The test name and location will be displayed.