Module etest

This modules provides a basic testing framework for AtomVM Erlang libraries.

Function Index

assert_equals/2
assert_failure/1
assert_failure/2
assert_match/2
assert_true/1
test/1 Test a sequence of test modules.

Function Details

assert_equals/2


assert_equals(X::term(), Y::term()) -> ok | fail

X: a term
Y: a term

returns: ok if X and Y are equal; fail otherwise.

assert_failure/1


assert_failure(F::function()) -> ok | fail

F: a function to evaluate

returns: ok if evaluating F results in Error being thrown; fail, otherwise

assert_failure/2


assert_failure(F::function(), Error::atom()) -> ok | fail

F: a function to evaluate

returns: ok if evaluating F results in Error being thrown; fail, otherwise

assert_match/2


assert_match(X::term(), X2::term()) -> ok | fail

X: a term

returns: ok if X and Y unify; fail otherwise.

assert_true/1


assert_true(X1::boolean()) -> ok | fail

returns: ok if X is true; fail otherwise.

test/1


test(Tests::[module()]) -> ok | fail

Tests: a list of test modules

returns: ok if all of the tests pass, or the atom fail, if any of the tests failed.

Test a sequence of test modules.

This function will execute the test/0 function for each module provided in the input list of test modules. If all of the tests return the atom ok, then this function returns ok. If any of the test modules return a value other than ok, then this function returns the atom fail.