Back to Atomvm

Module eunit

main-apidocs-erlang-etest-eunit.md

latest1.9 KB
Original Source

Module eunit

This modules provides an eunit-compatible API for AtomVM generating an output that can be parsed by dut.expect_unity_test_output.

Data Types

option()

option() = exact_execution | {exact_execution, boolean()}

test()

test() = fun(() -> term()) | atom() | {module, atom()} | {test, ModuleName::atom(), FunctionName::atom()} | {Line::pos_integer(), fun(() -> term())} | {generator, GenFun::fun(() -> test())} | {generator, ModuleName::atom(), FunctionName::atom()} | {Title::string(), test()} | [test()]

Function Index

| start/0 | | | test/1 | Equivalent to test(Tests, []). | | test/2 | Run tests print result using io:format in a format compatible with dut.expect_unity_test_output. |

Function Details

start/0

start() -> any()

test/1

test(Tests::test()) -> ok | {error, {failures, pos_integer()}}

Equivalent to test(Tests, []).

test/2

test(Tests::test(), Options::[option()]) -> ok | {error, {failures, pos_integer()}}

Tests: tests or module to run tests from
Options: options. If exact_execution is true and Tests is a module name, tests from the module with _tests suffix are not collected.

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

Run tests print result using io:format in a format compatible with dut.expect_unity_test_output.