45#ifndef MICRO_TEST_PLUS_TEST_RUNNER_H_
46#define MICRO_TEST_PLUS_TEST_RUNNER_H_
65#pragma GCC diagnostic push
66#pragma GCC diagnostic ignored "-Wpadded"
68#pragma clang diagnostic ignored "-Wc++98-compat"
70#pragma GCC diagnostic ignored "-Wsuggest-final-types"
71#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
72#pragma GCC diagnostic ignored "-Wredundant-tags"
129 runner (
const char* top_suite_name);
170 initialise (
int argc,
char* argv[],
const char* top_suite_name =
"");
196 template <
typename Callable_T,
typename... Args_T>
198 suite (
const char*
name, Callable_T&& callable, Args_T&&... arguments);
223 [[nodiscard]]
virtual size_t
253 [[nodiscard]] const
detail::timestamps&
423 [[nodiscard]]
virtual size_t
456#pragma GCC diagnostic pop
Base class for runners and runable tests.
const char * name(void) const noexcept
Gets the node name.
A begin/end timestamp pair used to measure elapsed time.
Local implementation of source location information for diagnostics.
static constexpr source_location current(const char *file="unknown", unsigned int line={}) noexcept
Obtain the current source location.
Reporter to display test results, including operand values and types for failures.
runner(runner &&)=delete
Deleted move constructor to prevent moving.
detail::timestamps & timings() noexcept
Gets the timings for this runner.
class reporter & reporter(void) const noexcept
Returns a reference to the test reporter.
void suite(const char *name, Callable_T &&callable, Args_T &&... arguments)
Adds a test suite to the runner.
std::string top_suite_name_
Owned storage for the implicit top-suite name.
virtual ~runner() override
Destructor for the runner class.
runner & operator=(const runner &)=delete
Deleted copy assignment operator to prevent copying.
runner(void)
Constructor for the runner class.
size_t suites_count(void) const noexcept
Returns the count of test suites.
void abort(const reflection::source_location &sl=reflection::source_location::current())
Aborts test execution immediately.
detail::timestamps timings_
Timings for this runner.
int exit_code(void)
Returns 0 if all tests were successful, 1 otherwise.
class top_suite top_suite_
The implicit top-level suite; always present and executed first.
std::vector< std::unique_ptr< class suite > > children_suites_
Owning collection of dynamically registered child suites.
void register_suite_(std::unique_ptr< class suite > suite)
Registers a test suite with the runner.
virtual size_t total_suites_count(void) const noexcept
Returns the total count of registered test suites.
std::unique_ptr< class reporter > reporter_
Pointer to the test reporter used for outputting test results.
class suite & initialise(int argc, char *argv[], const char *top_suite_name="")
Initialises the test runner with command-line arguments.
virtual void run_suites_(void)
Runs all registered test suites.
runner(const runner &)=delete
Deleted copy constructor to prevent copying.
static void register_static_suite(static_runner &runner, static_suite &suite)
Registers a static test suite with the runner.
std::vector< static_suite * > * static_children_suites_
Pointer to the vector of registered static test suites.
static_runner(void)
Constructor for the runner class.
static_runner(static_runner &&)=delete
Deleted move constructor to prevent moving.
static_runner(const static_runner &)=delete
Deleted copy constructor to prevent copying.
size_t static_suites_count(void) const noexcept
Returns the total count of registered static test suites.
A test suite designed for static (namespace-scope) registration with a static_runner.
A named, runnable test suite registered with the test runner.
The implicit top-level suite owned by every runner instance.
Internal implementation details for the µTest++ framework.
Primary namespace for the µTest++ testing framework.
C++ header file with declarations for the µTest++ reflection utilities.
C++ header file with inline implementations for the µTest++ test runner.
C++ header file with declarations for the µTest++ test suite.
C++ header file with declarations for the µTest++ timing utilities.