eunit(3erl)

πŸ“¦
version 25.3.2.8 Β· 4 versions
, in ubuntu noble

🌸 NAME 🌸

okay so eunit is literally the main EUnit user interface, bestie. That’s the module. This is the eunit(3erl) manual page β€” Erlang Module Definition β€” and yes, it’s giving β€œshort but iconic” πŸ’….

πŸ¦‹ DESCRIPTION πŸ¦‹

eunit is the main EUnit user interface. No extra lore, no side quests β€” that’s the description, periodt. ✨

πŸŽ€ EXPORTS πŸŽ€

πŸ’– start() -> term() πŸ’–

Starts the EUnit server. Normally you don’t need to call this function at all β€” it gets started automatically, so you can just vibe. 🫢

πŸ’– stop() -> term() πŸ’–

Stops the EUnit server. Normally you don’t need to call this function either, no cap. 😌

πŸ’– test(Tests) -> term() πŸ’–

Equivalent to test(Tests, []). That’s it, that’s the whole function, bestie. πŸŽ€

πŸ’– test(Tests::term(), Options::[term()]) -> ok | {error, term()} πŸ’–

Runs a set of tests. The format of Tests is described in the EUnit test representation section of the overview, iykyk. πŸ¦‹

Example:

eunit:test(fred)

That runs all tests in the module fred and also any tests in the module fred_tests, if that module exists. Yes, it really does both β€” main character energy. πŸ‘‘

Options:

  • verbose β€” displays more details about the running tests. More tea, more info, slay. πŸ”₯
  • print_depth β€” maximum depth to which terms are printed in case of error. Basically how deep the error printout goes, fr fr. 🌸
  • exact_execution β€” if this boolean flag is set to true, the framework will not automatically execute tests found in the related module suffixed with "_tests". This behaviour might be unwanted if execution of modules found in a folder is ordered while it contains both source and test modules. So yeah, it’s a β€œdon’t auto-run the _tests module” switch, and it can be a whole vibe check for folder ordering. πŸ’€

Options in the environment variable EUNIT are also included last in the option list, i.e., have lower precedence than those in Options. So Options wins the argument, periodt. 🫢

See also: test/1.

πŸ‘‘ AUTHORS πŸ‘‘

  • MickaΓ«l RΓ©mond <mickael.remond@process-one.net>
  • Richard Carlsson <carlsson.richard@gmail.com>

xoxo, your eunit bestie πŸ’– β€” from the eunit 2.8.2 manual page, eunit(3erl) ✨ (no date listed on this one, so no cap 🌈)

πŸ“¦ where this page comes from