|
kaycxx-test
C++ unit test framework
|
Registered setup or teardown hook. More...
#include <kaycxx/test/hook.hpp>
Public Member Functions | |
| hook (std::string_view name, callback body, std::source_location location=std::source_location::current()) | |
| Creates a hook. | |
| void | run (run_options const &options=run_options()) |
| Runs the hook and wraps thrown exceptions in a hook error with source location information. | |
Registered setup or teardown hook.
The hook stores the registration source location so hook failures can be reported at the user code that registered the hook.
|
explicit |
Creates a hook.
| name | Hook name used in failure messages. |
| body | Hook callback to execute. |
| location | Source location used when the hook throws an exception without its own location. |
| void kaycxx::test::hook::run | ( | run_options const & | options = run_options() | ) |
Runs the hook and wraps thrown exceptions in a hook error with source location information.
| options | Test execution options. |