micro-test-plus 4.1.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
deferred-reporter.h File Reference

C++ header file with declarations for the µTest++ deferred reporter. More...

#include <cstdio>
#include <string>
#include "type-traits.h"
#include "reflection.h"
#include "expression-formatter.h"
#include "inlines/deferred-reporter-inlines.h"

Go to the source code of this file.

Classes

class  micro_os_plus::micro_test_plus::detail::deferred_reporter
 Deferred reporter class for a specific expression. More...
class  micro_os_plus::micro_test_plus::detail::deferred_reporter_base
 Base class for a deferred reporter that collects messages into a string. More...

Namespaces

namespace  micro_os_plus
 The primary namespace for the µOS++ framework.
namespace  micro_os_plus::micro_test_plus
 Primary namespace for the µTest++ testing framework.
namespace  micro_os_plus::micro_test_plus::detail
 Internal implementation details for the µTest++ framework.

Detailed Description

This header provides the two deferred-reporter classes used by expect() and assume() to capture a test-expression result and format the outcome only when the reporter object is destroyed (i.e. at the semicolon following the expression statement).

  • deferred_reporter_base stores the boolean result, the source location, an optional user-supplied message (accumulated via operator<<), and a reference to the owning subtest. Its destructor calls the reporter to emit a pass or fail line.
  • deferred_reporter<Expr_T> derives from the base and additionally stores the original expression object so that the reporter can print the actual and expected values on failure.

Both classes live in the detail namespace and are not part of the public API.

This file is intended solely for internal use within the framework and should not be included directly by user code.

Definition in file deferred-reporter.h.