Skip to main content

reporter-human.h File

C++ header file with declarations for the µTest++ human-readable reporter. More...

Included Headers​

#include "reporter.h" #include "reflection.h"

Namespaces Index​

namespacemicro_os_plus

The primary namespace for the µOS++ framework. More...

namespacemicro_test_plus

Primary namespace for the µTest++ testing framework. More...

namespacedetail

Internal implementation details for the µTest++ framework. More...

Classes Index​

classreporter_human

Human (standard output) implementation of reporter. More...

Description​

C++ header file with declarations for the µTest++ human-readable reporter.

This header provides the declaration for reporter_human, a concrete implementation of the reporter abstract interface, selected with the --reporter=human command-line option, or with runner_options::selected_reporter (the default is TAP). It formats and presents test results in a human-readable form on the standard output, accumulating output in an internal string buffer and supporting colour-coded diagnostics and multiple verbosity levels.

All definitions reside within the micro_os_plus::micro_test_plus::detail namespace, since the reporters are internal to the framework.

This file is included by micro-os-plus/micro-test-plus.h, which is the header that the applications include.

File Listing​

The file content with the documentation metadata removed is:

1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2021-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can be
9 * obtained from https://opensource.org/licenses/mit.
10 */
11
12// ----------------------------------------------------------------------------
13
35
36#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_REPORTER_HUMAN_H_
37#define MICRO_OS_PLUS_MICRO_TEST_PLUS_REPORTER_HUMAN_H_
38
39// ----------------------------------------------------------------------------
40
41#if defined(__cplusplus)
42
43// ----------------------------------------------------------------------------
44
45#if __has_include("micro-os-plus/project-config.h")
46#include "micro-os-plus/project-config.h"
47#endif // __has_include("micro-os-plus/project-config.h")
48
49#if __has_include("micro-os-plus/micro-test-plus-defines.h")
50#include "micro-os-plus/micro-test-plus-defines.h"
51#endif // __has_include("micro-os-plus/micro-test-plus-defines.h")
52
53#include "reporter.h"
54#include "reflection.h"
55
56// ----------------------------------------------------------------------------
57
58#if defined(__GNUC__)
59#pragma GCC diagnostic push
60
61#pragma GCC diagnostic ignored "-Wpadded"
62#if defined(__clang__)
63#pragma clang diagnostic ignored "-Wc++98-compat"
64#endif // defined(__clang__)
65#endif // defined(__GNUC__)
66
67// ============================================================================
68
70{
71 // ==========================================================================
72
101 class reporter_human final : public reporter
102 {
103 public:
110 explicit reporter_human (const runner_options& opts);
111
119 reporter_human (const reporter_human&) = delete;
120
129
139 = delete;
140
150 = delete;
151
158 ~reporter_human () override;
159
160 // ------------------------------------------------------------------------
161
169 void
170 begin_session (const runner& runner) override;
171
179 void
180 end_session (const runner& runner) override;
181
189 void
190 begin_suite (const suite& suite) override;
191
199 void
200 end_suite (const suite& suite) override;
201
213 void
214 skip_suite (const suite& suite) override;
215
228 void
229 fail_suite (const std::string& message, const suite& suite) override;
230
238 void
239 begin_test_case (const test_case& test_case) override;
240
248 void
249 end_test_case (const test_case& test_case) override;
250
262 void
263 skip_test_case (const test_case& test_case) override;
264
277 void
278 pass_without_text (const test_case& test_case) override;
279
296 void
298 bool is_requirement) override;
299
308 const char*
309 comment_prefix (void) const noexcept override;
310
311 private:
320 void
321 output_pass_prefix (const std::string& message,
322 const test_case& test_case) override;
323
331 void
332 output_pass_suffix (const test_case& test_case) override;
333
345 void
346 output_fail_prefix (const std::string& message, const bool has_expression,
347 const reflection::source_location& location,
348 const test_case& test_case) override;
349
361 void
363 check_kind kind, const test_case& test_case) override;
364
378 void
379 commit_buffer (void) override;
380
399 void
400 display_open_names (bool include_last);
401
416 void
417 display_open_heading (const open_test_case& open, bool is_first) override;
418 };
419
420 // --------------------------------------------------------------------------
421} // namespace micro_os_plus::micro_test_plus::detail
422
423#if defined(__GNUC__)
424#pragma GCC diagnostic pop
425#endif // defined(__GNUC__)
426
427// ----------------------------------------------------------------------------
428
429#endif // defined(__cplusplus)
430
431// ----------------------------------------------------------------------------
432
433#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_REPORTER_HUMAN_H_
434
435// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.