Module autotest

A minimalistic autotest suite for YXA.

Introduced in: 25 Oct 2004 by Håkan Stenholm <hsten@it.su.se>

Authors: Håkan Stenholm (hsten@it.su.se).

Description

A minimalistic autotest suite for YXA. Test granularity is on a module basis, rather than the prefered test cases basis.

Function Index

aggregate_coverage/1 Aggregate cover analysis data for Modules.
clear_unit_test_result/2 Clear any stored value for this Key.
fail/1 test case support function, used to check if call Fun() fails - as expected.
is_unit_testing/2 Check if we are currently unit testing and have a result stored for the user of this specific Key.
mark/2Equivalent to mark(Line, Msg, []).
mark/3 Mark a new test.
run/0Equivalent to run([erl]).
run/1 Test all modules listed in ModulesToAutoTest and print the result.
run_cover/1 Run our tests after cover-compiling the modules.
store_unit_test_result/3 Store a value to be returned for this Key.

Function Details

aggregate_coverage/1

aggregate_coverage(Modules) -> {ok, CoveredLines, TotalLines, ModuleStats}

Aggregate cover analysis data for Modules.

clear_unit_test_result/2

clear_unit_test_result(Module, Key) -> term()

Clear any stored value for this Key.

fail/1

fail(Fun) -> ok

throws {error, no_exception_thrown_by_test}

test case support function, used to check if call Fun() fails - as expected

is_unit_testing/2

is_unit_testing(Module, Key) -> {true, Result} | false

Check if we are currently unit testing and have a result stored for the user of this specific Key.

mark/2

mark(Line, Msg) -> ok

Equivalent to mark(Line, Msg, []).

mark/3

mark(Line, Fmt, Args) -> ok

Mark a new test. Record whereabout information in the process dictionary to help locate failing tests at the end result stage.

run/0

run() -> ok | error

Equivalent to run([erl]).

run/1

run(X1::[Mode]) -> ok | error

Test all modules listed in ModulesToAutoTest and print the result. If Mode is 'shell' we end with halting the erlang runtime system, with exit status 1 if any tests fail and

run_cover/1

run_cover(X1::[Mode]) -> ok | error

Run our tests after cover-compiling the modules. Show some numbers about the coverage ratio before exiting.

store_unit_test_result/3

store_unit_test_result(Module, Key, Value) -> term()

Store a value to be returned for this Key.


Generated by EDoc, Oct 17 2007, 16:48:23.