48#ifndef MICRO_TEST_PLUS_REFLECTION_H_
49#define MICRO_TEST_PLUS_REFLECTION_H_
59#if defined(__cpp_lib_source_location)
60#include <source_location>
66#pragma GCC diagnostic push
67#pragma GCC diagnostic ignored "-Wpadded"
68#pragma GCC diagnostic ignored "-Waggregate-return"
70#pragma clang diagnostic ignored "-Wc++98-compat"
71#pragma clang diagnostic ignored "-Wunknown-warning-option"
100#if defined(__cpp_lib_source_location)
146 [[nodiscard]]
static constexpr auto
148#
if (__has_builtin(__builtin_FILE) and __has_builtin(__builtin_LINE))
149 const char* file = __builtin_FILE (),
150 unsigned int line = __builtin_LINE ()
152 const char* file =
"unknown",
unsigned int line = {}
163 [[nodiscard]]
constexpr auto
173 [[nodiscard]]
constexpr auto
174 line (
void)
const noexcept;
212 [[nodiscard]]
constexpr auto
222#pragma GCC diagnostic pop
Local implementation of source location information for diagnostics.
unsigned int line_
The line number where the source location was captured.
constexpr auto file_name(void) const noexcept
Retrieve the file name associated with this source location.
constexpr auto line(void) const noexcept
Retrieve the line number associated with this source location.
static constexpr auto current(const char *file="unknown", unsigned int line={}) noexcept
Obtain the current source location.
const char * file_
The file name where the source location was captured.
Reflection utilities for the µTest++ testing framework.
constexpr auto type_name(void) -> std::string_view
Extract the type name from the __PRETTY_FUNCTION__ macro.
const char * short_name(const char *name)
Extract a short type or function name from a fully qualified name.
Primary namespace for the µTest++ testing framework.