49#if __has_include("micro-os-plus/diag/trace.h")
50#include "micro-os-plus/diag/trace.h"
57#pragma clang diagnostic ignored "-Wunknown-warning-option"
58#pragma clang diagnostic ignored "-Wc++98-compat"
59#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
60#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
62#pragma GCC diagnostic ignored "-Wredundant-tags"
63#pragma GCC diagnostic ignored "-Wsuggest-final-types"
64#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
70#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
88#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
89 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name);
101#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
102 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
122#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
123 trace::printf (
"%s '%s' %zu\n", __PRETTY_FUNCTION__,
name,
own_index_);
136#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
137 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
178 std::unique_ptr<class subtest> child_test,
suite&
suite)
188#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
189 trace::printf (
"%s subtest '%s' executed one more subtest\n",
190 __PRETTY_FUNCTION__,
name ());
196#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
197 trace::printf (
"%s suite '%s' totals\n", __PRETTY_FUNCTION__,
219#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
220 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
232#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
233 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
260#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
261 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
273#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
274 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
302#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
303 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name);
317#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
318 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
332#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
333 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
347#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
348 trace::printf (
"%s '%s'\n", __PRETTY_FUNCTION__,
name_);
class runner & runner(void) const noexcept
Gets the test runner associated with this test runnable.
runnable_base(const char *name, runner &runner, size_t own_index)
Constructs a runnable_base with a name, runner, and index.
void after_subtest_create_(std::unique_ptr< subtest > child_test, suite &suite)
Registers a newly constructed child subtest and executes it immediately.
size_t own_index_
The test index, counting from 1.
size_t own_index() const noexcept
Returns the positional index of this object within its parent.
class reporter & reporter(void) const noexcept
Gets the test reporter associated with this test runnable.
class runner & runner_
Reference to the test runner that owns this object.
virtual ~runnable_base() override
Virtual destructor.
void abort(const reflection::source_location &sl=reflection::source_location::current())
Aborts test execution via the owning runner.
std::vector< std::unique_ptr< subtest > > children_subtests_
Owning collection of direct child subtests.
std::function< void(subtest &)> callable_
void increment_executed_subtests(size_t count=1) noexcept
Increments the executed-subtests counter.
const char * name(void) const noexcept
Gets the node name.
virtual ~test_node()
Virtual destructor for the test_node class.
runner_totals & totals() noexcept
Gets the totals for the test.
test_node(const char *name)
Constructs a test node.
const char * name_
The test node name.
void timestamp_begin(void) noexcept
Records the begin timestamp using the current system clock.
void timestamp_end(void) noexcept
Records the end timestamp using the current system clock.
Local implementation of source location information for diagnostics.
Reporter to display test results, including operand values and types for failures.
virtual void begin_subtest(subtest &subtest)=0
Mark the beginning of a subtest.
virtual void begin_suite(suite &suite)=0
Mark the beginning of a test suite.
virtual void end_suite(suite &suite)=0
Mark the end of a test suite.
The test runner for the µTest++ framework.
std::function< void(static_suite &)> static_callable_
Callable storing the static suite body and any bound arguments. Invoked with a reference to the concr...
virtual void run(void) override
Executes the static suite body using the stored static callable.
virtual ~static_suite() override
Virtual destructor.
A named, runnable test case that lives inside a suite.
virtual ~subtest() override
Virtual destructor.
virtual void run(void) override
Executes the subtest body by invoking the stored callable.
A named, runnable test suite registered with the test runner.
suite(const char *name, class runner &runner, Callable_T &&callable, Args_T &&... arguments)
Constructs a suite with a name, runner, and callable body.
virtual void run(void) override
Executes the suite body by invoking the stored callable.
detail::timestamps & timings() noexcept
Gets the timings for this suite.
virtual ~suite() override
Virtual destructor.
void name(const char *new_name) noexcept
Sets the name of the top-level suite.
top_suite(const char *name, class runner &runner)
Constructs the top-level suite with a name and runner reference.
virtual ~top_suite() override
Virtual destructor.
Internal implementation details for the µTest++ framework.
Primary namespace for the µTest++ testing framework.
C++ header file with declarations for the µTest++ test runner.
C++ header file with declarations for the µTest++ test suite.