Skip to main content

reporter-tap.h File

C++ header file with declarations for the µTest++ TAP test 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...

Classes Index

classreporter_tap

TAP (Test Anything Protocol) implementation of reporter. More...

Description

C++ header file with declarations for the µTest++ TAP test reporter.

This header provides the declaration for reporter_tap, a concrete implementation of the reporter abstract interface that formats test results according to the Test Anything Protocol (TAP).

All definitions reside within the micro_os_plus::micro_test_plus namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.

The header files are organised within the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.

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

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 * Major parts of the code are inspired from v1.1.8 of the Boost UT project,
12 * released under the terms of the Boost Version 1 Software License,
13 * which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
14 */
15
16// ----------------------------------------------------------------------------
17
38
39#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_TEST_REPORTER_TAP_H_
40#define MICRO_OS_PLUS_MICRO_TEST_PLUS_TEST_REPORTER_TAP_H_
41
42// ----------------------------------------------------------------------------
43
44#if defined(__cplusplus)
45
46// ----------------------------------------------------------------------------
47
48#if __has_include("micro-os-plus/project-config.h")
49#include "micro-os-plus/project-config.h"
50#endif // __has_include("micro-os-plus/project-config.h")
51
52#if __has_include("micro-os-plus/micro-test-plus-defines.h")
53#include "micro-os-plus/micro-test-plus-defines.h"
54#endif // __has_include("micro-os-plus/micro-test-plus-defines.h")
55
56#include "reporter.h"
57#include "reflection.h"
58
59// ----------------------------------------------------------------------------
60
61#if defined(__GNUC__)
62#pragma GCC diagnostic push
63
64#pragma GCC diagnostic ignored "-Wpadded"
65#if defined(__clang__)
66#pragma clang diagnostic ignored "-Wc++98-compat"
67#endif // defined(__clang__)
68#endif // defined(__GNUC__)
69
70// ============================================================================
71
73{
74 // --------------------------------------------------------------------------
75
76 class runner;
77 class suite;
78 class subtest;
79
80 // ==========================================================================
81
102 class reporter_tap final : public reporter
103 {
104 public:
111 reporter_tap (std::unique_ptr<std::vector<std::string_view>> argvs);
112
116 reporter_tap (const reporter_tap&) = delete;
117
122
128 = delete;
129
135 = delete;
136
140 ~reporter_tap () override;
141
142 // ------------------------------------------------------------------------
143
152
153 // Bring base class operator<< overloads into scope to prevent name hiding.
154 using reporter::operator<<;
155
156 // ------------------------------------------------------------------------
157
165 void
166 begin_session (runner& runner) override;
167
175 void
176 end_session (runner& runner) override;
177
185 virtual void
186 begin_suite (suite& suite) override;
187
195 virtual void
196 end_suite (suite& suite) override;
197
205 virtual void
206 begin_subtest (subtest& subtest) override;
207
215 virtual void
216 end_subtest (subtest& subtest) override;
217
226 virtual const char*
227 get_comment_prefix (void) override;
228
229 protected:
238 void
239 output_pass_prefix_ (std::string& message, subtest& subtest) override;
240
248 void
250
262 void
263 output_fail_prefix_ (std::string& message, const bool has_expression,
264 const reflection::source_location& location,
265 subtest& subtest) override;
266
276 void
278 bool abort, subtest& subtest) override;
279 };
280
281 // --------------------------------------------------------------------------
282} // namespace micro_os_plus::micro_test_plus
283
284#if defined(__GNUC__)
285#pragma GCC diagnostic pop
286#endif // defined(__GNUC__)
287
288// ----------------------------------------------------------------------------
289
290#endif // defined(__cplusplus)
291
292// ----------------------------------------------------------------------------
293
294#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_TEST_REPORTER_TAP_H_
295
296// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.17.0.