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...

namespacedetail

Internal implementation details for the µTest++ 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), version 14.

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
30
31#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_REPORTER_TAP_H_
32#define MICRO_OS_PLUS_MICRO_TEST_PLUS_REPORTER_TAP_H_
33
34// ----------------------------------------------------------------------------
35
36#if defined(__cplusplus)
37
38// ----------------------------------------------------------------------------
39
40#if __has_include("micro-os-plus/project-config.h")
41#include "micro-os-plus/project-config.h"
42#endif // __has_include("micro-os-plus/project-config.h")
43
44#if __has_include("micro-os-plus/micro-test-plus-defines.h")
45#include "micro-os-plus/micro-test-plus-defines.h"
46#endif // __has_include("micro-os-plus/micro-test-plus-defines.h")
47
48#include "reporter.h"
49#include "reflection.h"
50
51// ----------------------------------------------------------------------------
52
53#if defined(__GNUC__)
54#pragma GCC diagnostic push
55
56#pragma GCC diagnostic ignored "-Wpadded"
57#if defined(__clang__)
58#pragma clang diagnostic ignored "-Wc++98-compat"
59#endif // defined(__clang__)
60#endif // defined(__GNUC__)
61
62// ============================================================================
63
65{
66 // ==========================================================================
67
90 class reporter_tap final : public reporter
91 {
92 public:
99 explicit reporter_tap (const runner_options& opts);
100
108 reporter_tap (const reporter_tap&) = delete;
109
118
128 = delete;
129
139 = delete;
140
147 ~reporter_tap () override;
148
149 // ------------------------------------------------------------------------
150
158 void
159 begin_session (const runner& runner) override;
160
168 void
169 end_session (const runner& runner) override;
170
178 void
179 begin_suite (const suite& suite) override;
180
188 void
189 end_suite (const suite& suite) override;
190
202 void
203 skip_suite (const suite& suite) override;
204
217 void
218 fail_suite (const std::string& message, const suite& suite) override;
219
227 void
228 begin_test_case (const test_case& test_case) override;
229
237 void
238 end_test_case (const test_case& test_case) override;
239
251 void
252 skip_test_case (const test_case& test_case) override;
253
267 void
268 pass_without_text (const test_case& test_case) override;
269
285 void
287 bool is_requirement) override;
288
297 const char*
298 comment_prefix (void) const noexcept override;
299
308 const char*
309 error_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
360 void
362 check_kind kind, const test_case& test_case) override;
363
377 void
378 commit_buffer (void) override;
379
396 void
397 display_open_heading (const open_test_case& open, bool is_first) override;
398
417 void
419
430
441 size_t condition_begin_ = std::string::npos;
442 };
443
444 // --------------------------------------------------------------------------
445} // namespace micro_os_plus::micro_test_plus::detail
446
447#if defined(__GNUC__)
448#pragma GCC diagnostic pop
449#endif // defined(__GNUC__)
450
451// ----------------------------------------------------------------------------
452
453#endif // defined(__cplusplus)
454
455// ----------------------------------------------------------------------------
456
457#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_REPORTER_TAP_H_
458
459// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.