micro-test-plus
6.0.1
µTest++ Testing Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
exceptions.h
Go to the documentation of this file.
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
* Major parts of the code are inspired from v1.1.8 of the Boost UT project,
12
* released under the terms of the Boost Version 1.0 Software License,
13
* which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
14
*/
15
16
// ----------------------------------------------------------------------------
17
36
37
#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_EXCEPTIONS_H_
38
#define MICRO_OS_PLUS_MICRO_TEST_PLUS_EXCEPTIONS_H_
39
40
// ----------------------------------------------------------------------------
41
42
#if defined(__cplusplus)
43
44
// ----------------------------------------------------------------------------
45
46
#if __has_include("micro-os-plus/project-config.h")
47
#include "micro-os-plus/project-config.h"
48
#endif
// __has_include("micro-os-plus/project-config.h")
49
50
#if __has_include("micro-os-plus/micro-test-plus-defines.h")
51
#include "micro-os-plus/micro-test-plus-defines.h"
52
#endif
// __has_include("micro-os-plus/micro-test-plus-defines.h")
53
54
#include "
detail.h
"
55
56
// ----------------------------------------------------------------------------
57
58
#if defined(__GNUC__)
59
#pragma GCC diagnostic push
60
61
#pragma GCC diagnostic ignored "-Waggregate-return"
62
#if defined(__clang__)
63
#pragma clang diagnostic ignored "-Wc++98-compat"
64
#endif
// defined(__clang__)
65
#endif
// defined(__GNUC__)
66
67
// ============================================================================
68
69
namespace
micro_os_plus::micro_test_plus
70
{
71
// --------------------------------------------------------------------------
72
73
#if defined(__cpp_exceptions)
74
96
template
<
class
Exception_T,
class
Callable_T>
97
requires
std::invocable<Callable_T&>
98
[[nodiscard]]
auto
99
throws
(Callable_T&& func);
100
118
template
<
class
Callable_T>
119
requires
std::invocable<Callable_T&>
120
[[nodiscard]]
auto
121
throws
(Callable_T&& func);
122
135
template
<
class
Callable_T>
136
requires
std::invocable<Callable_T&>
137
[[nodiscard]]
auto
138
nothrow
(Callable_T&& func);
139
140
#endif
// defined(__cpp_exceptions)
141
142
// --------------------------------------------------------------------------
143
}
// namespace micro_os_plus::micro_test_plus
144
145
#if defined(__GNUC__)
146
#pragma GCC diagnostic pop
147
#endif
// defined(__GNUC__)
148
149
// ----------------------------------------------------------------------------
150
151
#endif
// defined(__cplusplus)
152
153
// ============================================================================
154
// Templates, inlines & constexpr implementations.
155
156
#include "
inlines/exceptions-inlines.h
"
157
158
// ----------------------------------------------------------------------------
159
160
#endif
// MICRO_OS_PLUS_MICRO_TEST_PLUS_EXCEPTIONS_H_
161
162
// ----------------------------------------------------------------------------
detail.h
C++ header file with declarations for the µTest++ internals.
exceptions-inlines.h
C++ header file with inline implementations for the µTest++ exceptions comparators.
micro_os_plus::micro_test_plus::nothrow
auto nothrow(Callable_T &&func)
Checks whether a callable does not throw any exception, for expect() or require().
Definition
exceptions-inlines.h:116
micro_os_plus::micro_test_plus
Primary namespace for the µTest++ testing framework.
Definition
check-result.h:76
include
micro-os-plus
micro-test-plus
exceptions.h
Generated by
1.18.0