test-reporter-basic.cpp File
C++ source file with implementations for the µTest++ basic test reporter methods. More...
Namespaces Index
Description
C++ source file with implementations for the µTest++ basic test reporter methods.
This source file contains the implementations for test_reporter_basic, the default concrete implementation of the test_reporter abstract interface. It formats and presents test results using printf-based 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 namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.
This file must be included when building the µTest++ library.
File Listing
The file content with the documentation metadata removed is:
39#if defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
40#include <micro-os-plus/config.h>
47#pragma GCC diagnostic ignored "-Waggregate-return"
49#pragma clang diagnostic ignored "-Wunknown-warning-option"
50#pragma clang diagnostic ignored "-Wc++98-compat"
51#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
85 if (!message.empty ())
87 *this << message.c_str ();
127 std::string& message, const bool hasExpression,
137 if (!message.empty ())
139 *this << message.c_str ();
143#pragma GCC diagnostic push
144#if defined(__clang__)
145#pragma clang diagnostic ignored "-Wsign-conversion"
146#elif defined(__GNUC__)
147#pragma GCC diagnostic ignored "-Wnarrowing"
148#pragma GCC diagnostic ignored "-Wsign-conversion"
154#pragma GCC diagnostic pop
177 *this << " aborted...";
266#pragma GCC diagnostic push
267#if defined(__clang__)
268#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
270 printf (" • %s - test case started\n", name);
273 " %s✗%s %s - test case %sFAILED%s (%zu check%s passed, %zu "
281#pragma GCC diagnostic pop
292#pragma GCC diagnostic push
293#if defined(__clang__)
294#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
296 printf (" • %s - test case started\n", name);
299 " %s✓%s %s - test case passed (%zu check%s)\n",
306#pragma GCC diagnostic pop
311#pragma GCC diagnostic push
312#if defined(__clang__)
313#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
316 " %s✓%s %s - test case passed (%zu check%s)\n",
323#pragma GCC diagnostic pop
361#pragma GCC diagnostic push
362#if defined(__clang__)
363#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
365 printf ("• %s - test suite started\n", name);
366#pragma GCC diagnostic pop
400#pragma GCC diagnostic push
401#if defined(__clang__)
402#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
405 "%s✓%s %s - test suite passed (%zu check%s in %zu test case%s)\n",
411#pragma GCC diagnostic pop
415#pragma GCC diagnostic push
416#if defined(__clang__)
417#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
419 printf ("%s✗%s %s - test suite %sFAILED%s (%zu check%s passed, %zu "
421 "in %zu test case%s)\n",
427#pragma GCC diagnostic pop
438#pragma GCC diagnostic push
439#pragma GCC diagnostic ignored "-Wshadow"
445#pragma GCC diagnostic pop
459 printf ("%s", out_.c_str ());
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.14.0.