C++ source file with implementations for the µTest++ human-readable reporter member functions. More...
Namespaces Index
Description
C++ source file with implementations for the µTest++ human-readable reporter member functions.
This source file contains the implementations for reporter_human, the concrete implementation of the reporter abstract interface that 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 must be included when building the µTest++ library.
File Listing
The file content with the documentation metadata removed is:
40#if __has_include("micro-os-plus/diag/trace.h")
41#include "micro-os-plus/diag/trace.h"
44#if defined(__APPLE__) || defined(__linux__) || defined(__unix__)
52#pragma GCC diagnostic ignored "-Waggregate-return"
54#pragma clang diagnostic ignored "-Wunknown-warning-option"
55#pragma clang diagnostic ignored "-Wc++98-compat"
56#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
57#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
63#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
83#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
84 trace::printf ("%s\n", __PRETTY_FUNCTION__);
89#if defined(__APPLE__) || defined(__linux__) || defined(__unix__)
110#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
111 trace::printf ("%s\n", __PRETTY_FUNCTION__);
129#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
130 trace::printf ("%s\n", __PRETTY_FUNCTION__);
142 write_line (to_console, "µTest++ human-readable report\n");
163#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
164 trace::printf ("%s\n", __PRETTY_FUNCTION__);
210#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
211 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, suite.name ());
257#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
258 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, suite.name ());
285 else if (!lines.empty ())
298 if (passed) [[likely]]
310 write_line (to_console, "%s✗%s %s - %sFAILED%s (%s)%s\n",
336#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
337 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, suite.name ());
369#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
370 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, suite.name ());
373 const size_t begin = buffer_.size ();
400#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
401 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, test_case.name ());
454#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
476 const bool shows = to_console || !lines.empty ();
495 if (passed) [[likely]]
507 write_line (to_console, "%s%s✗%s %s - %sFAILED%s (%s)\n",
559 *this << indent (level + 1);
561 if (!message.empty ())
596 const std::string& message, const bool has_expression,
600#pragma GCC diagnostic push
602#if defined(__clang__)
603#pragma clang diagnostic ignored "-Wsign-conversion"
604#elif defined(__GNUC__)
605#pragma GCC diagnostic ignored "-Wnarrowing"
606#pragma GCC diagnostic ignored "-Wsign-conversion"
612 *this << indent (level + 1);
614 if (!message.empty ())
629#pragma GCC diagnostic pop
653#if defined(__cpp_exceptions)
654 *this << " - test case stopped";
656 *this << " - test execution aborted";
679#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
680 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, test_case.name ());
752 [[maybe_unused]] bool is_requirement)
754#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
755 trace::printf ("%s\n", __PRETTY_FUNCTION__);
763 const unsigned long line = location.line ();
773 bool has_results = !lines.empty ()
777 has_results = has_results || !open.name_displayed;
797 write_line (to_console, "%s✗%s Test execution aborted at %s:%lu\n",
Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.