object

lgtunit

Logtalk unit test framework.

author:
Paulo Moura
version:
0.2
date:
2007/8/27
compilation:
static

(no dependencies on other files)

Public interface

succeeds/2

Defines a test goal which is expected to succeed.

compilation:
static
template:
succeeds(Test, Goal)
mode – number of solutions:
succeeds(+atom, @callable) – zero_or_more

fails/2

Defines a test goal which is expected to fail.

compilation:
static
template:
fails(Test, Goal)
mode – number of solutions:
fails(+atom, @callable) – zero_or_more

throws/3

Defines a test goal which is expected to throw an error.

compilation:
static
template:
throws(Test, Goal, Error)
mode – number of solutions:
throws(+atom, @callable, @nonvar) – zero_or_more

run/2

Runs the unit tests, writing the results to the specified file. Mode can be either "write" (to create a new file) or "append" (to add results to an existing file).

compilation:
static
template:
run(File, Mode)
mode – number of solutions:
run(+atom, +atom) – zero_or_one

run/0

Runs the unit tests, writing the results to the current output stream.

compilation:
static
mode – number of solutions:
run – zero_or_one

Protected interface

setup/0

Setup environment before running the test. Defaults to the goal true.

compilation:
static
mode – number of solutions:
setup – zero_or_one

test/0

Executes the tests. By default, starts with the "succeeds" tests, followed by the "fails" tests, and than the "throws" tests.

compilation:
static
mode – number of solutions:
test – zero_or_one

cleanup/0

Cleanup environment after running the test. Defaults to the goal true.

compilation:
static
mode – number of solutions:
cleanup – zero_or_one

Private predicates

(none)

Remarks

(none)