46#if defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
47#include <micro-os-plus/config.h>
57#pragma clang diagnostic ignored "-Wc++98-compat"
58#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
77#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
78 printf (
"%s\n", __PRETTY_FUNCTION__);
108#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
109 printf (
"%s\n", __PRETTY_FUNCTION__);
124#if defined(_WIN32) || defined(CLOCK_MONOTONIC)
126 timespec_get (&begin_time, TIME_UTC);
128 clock_gettime (CLOCK_MONOTONIC, &begin_time);
156#if defined(_WIN32) || defined(CLOCK_MONOTONIC)
158 timespec_get (&end_time, TIME_UTC);
160 clock_gettime (CLOCK_MONOTONIC, &end_time);
236#if defined(_WIN32) || defined(CLOCK_MONOTONIC)
244#pragma GCC diagnostic push
245#pragma GCC diagnostic ignored "-Wshadow"
247 test_suite_base::compute_elapsed_time (timespec& begin_time,
252 long long delta_ns = end_time.tv_nsec - begin_time.tv_nsec;
253 long long delta_s = end_time.tv_sec - begin_time.tv_sec;
256 delta_ns += 1000000000LL;
261 const long long total_us = delta_s * 1000000LL + delta_ns / 1000LL;
262 milliseconds =
static_cast<long> (total_us / 1000LL);
263 microseconds =
static_cast<long> (total_us % 1000LL);
265#pragma GCC diagnostic pop
296#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
297 printf (
"%s\n", __PRETTY_FUNCTION__);
virtual void run(void)
Runs the sequence of test cases in the suite.
test_suite_base(const char *name)
Constructs a test suite.
void increment_failed(void)
Increments the count of failed test conditions.
constexpr const char * name(void)
Gets the suite name.
size_t test_cases_count_
Count of test cases in the test suite.
void begin_test_case(const char *name)
Marks the beginning of a named test case.
const char * name_
The test suite name.
void increment_successful(void)
Increments the count of passed test conditions.
virtual ~test_suite_base()
Virtual destructor for the test_suite_base class.
void end_test_suite(void)
Marks the end of the test suite.
void end_test_case(void)
Marks the end of a test case.
size_t successful_checks_
Count of test conditions that passed.
bool process_deferred_begin
Indicates whether to process deferred begin for test cases.
struct micro_os_plus::micro_test_plus::test_suite_base::@025050103341037176303320301005170305141235061044 current_test_case
Structure holding the current test case's check counters.
void begin_test_suite(void)
Begins the execution of the test suite.
const char * test_case_name_
The current test case name.
size_t failed_checks_
Count of test conditions that failed.
std::function< void(void)> callable_
Callable object representing the test suite's execution logic.
virtual void run(void) override
Runs the sequence of test cases in the suite by invoking the stored callable.
virtual ~test_suite() override
Virtual destructor for the test_suite class.
Main C++ header with the declarations for the µTest++ Testing Framework.
Primary namespace for the µTest++ testing framework.
test_reporter * reporter
Global pointer to test_reporter.
test_runner runner
Global instance of test_runner.