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_TEST_PLUS_TEST_REPORTER_TAP_H_
40#define MICRO_TEST_PLUS_TEST_REPORTER_TAP_H_
41
42// ----------------------------------------------------------------------------
43
44#ifdef __cplusplus
45
46// ----------------------------------------------------------------------------
47
48#include "reporter.h"
49#include "reflection.h"
50
51// ----------------------------------------------------------------------------
52
53#if defined(__GNUC__)
54#pragma GCC diagnostic push
55#pragma GCC diagnostic ignored "-Wpadded"
56#if defined(__clang__)
57#pragma clang diagnostic ignored "-Wc++98-compat"
58#endif
59#endif
60
61// ============================================================================
62
64{
65 // --------------------------------------------------------------------------
66
67 class runner;
68 class suite;
69 class subtest;
70
71 // ==========================================================================
72
93 class reporter_tap final : public reporter
94 {
95 public:
102 reporter_tap (std::unique_ptr<std::vector<std::string_view>> argvs);
103
107 reporter_tap (const reporter_tap&) = delete;
108
113
119 = delete;
120
126 = delete;
127
131 ~reporter_tap () override;
132
133 // ------------------------------------------------------------------------
134
143
144 // Bring base class operator<< overloads into scope to prevent name hiding.
145 using reporter::operator<<;
146
147 // ------------------------------------------------------------------------
148
156 void
157 begin_session (runner& runner) override;
158
166 void
167 end_session (runner& runner) override;
168
176 virtual void
177 begin_suite (suite& suite) override;
178
186 virtual void
187 end_suite (suite& suite) override;
188
196 virtual void
197 begin_subtest (subtest& subtest) override;
198
206 virtual void
207 end_subtest (subtest& subtest) override;
208
217 virtual const char*
218 get_comment_prefix (void) override;
219
220 protected:
229 void
230 output_pass_prefix_ (std::string& message, subtest& subtest) override;
231
239 void
241
253 void
254 output_fail_prefix_ (std::string& message, const bool has_expression,
255 const reflection::source_location& location,
256 subtest& subtest) override;
257
267 void
269 bool abort, subtest& subtest) override;
270 };
271
272 // --------------------------------------------------------------------------
273} // namespace micro_os_plus::micro_test_plus
274
275#if defined(__GNUC__)
276#pragma GCC diagnostic pop
277#endif
278
279// ----------------------------------------------------------------------------
280
281#endif // __cplusplus
282
283// ----------------------------------------------------------------------------
284
285#endif // MICRO_TEST_PLUS_TEST_REPORTER_TAP_H_
286
287// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.