micro-test-plus
6.0.0
µTest++ Testing Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
runner-options-inlines.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
12
// ----------------------------------------------------------------------------
13
31
32
#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_RUNNER_OPTIONS_INLINES_H_
33
#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_RUNNER_OPTIONS_INLINES_H_
34
35
// ----------------------------------------------------------------------------
36
37
#if defined(__cplusplus)
38
39
// ----------------------------------------------------------------------------
40
41
#if defined(__GNUC__)
42
#pragma GCC diagnostic push
43
44
#pragma GCC diagnostic ignored "-Waggregate-return"
45
#if defined(__clang__)
46
#pragma clang diagnostic ignored "-Wc++98-compat"
47
#endif
// defined(__clang__)
48
#endif
// defined(__GNUC__)
49
50
// ============================================================================
51
52
namespace
micro_os_plus::micro_test_plus
53
{
54
// ==========================================================================
55
61
inline
runner_options
&
62
runner_options::operator=
(
const
runner_options
& other)
63
{
64
runner_options
copy{ other };
65
*
this
= std::move (copy);
66
return
*
this
;
67
}
68
73
inline
bool
74
runner_options::has_errors
(
void
)
const
noexcept
75
{
76
return
!
errors_
.empty ();
77
}
78
83
inline
bool
84
runner_options::has_unknown_option
(
void
)
const
noexcept
85
{
86
return
unknown_option_
;
87
}
88
93
inline
const
std::vector<std::string>&
94
runner_options::errors
(
void
)
const
noexcept
95
{
96
return
errors_
;
97
}
98
104
inline
const
std::vector<std::string>&
105
runner_options::arguments
(
void
)
const
noexcept
106
{
107
return
arguments_
;
108
}
109
116
inline
std::span<const std::string>
117
runner_options::application_arguments
(
void
)
const
noexcept
118
{
119
if
(
application_begin_
>=
arguments_
.size ())
120
{
121
return
{};
122
}
123
124
return
std::span<const std::string>{
arguments_
}.subspan (
125
application_begin_
);
126
}
127
128
// --------------------------------------------------------------------------
129
}
// namespace micro_os_plus::micro_test_plus
130
131
// ----------------------------------------------------------------------------
132
133
#if defined(__GNUC__)
134
#pragma GCC diagnostic pop
135
#endif
// defined(__GNUC__)
136
137
// ----------------------------------------------------------------------------
138
139
#endif
// defined(__cplusplus)
140
141
// ----------------------------------------------------------------------------
142
143
#endif
// MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_RUNNER_OPTIONS_INLINES_H_
144
145
// ----------------------------------------------------------------------------
micro_os_plus::micro_test_plus::runner_options
The configuration of a test session, and its command-line parser.
Definition
runner-options.h:218
micro_os_plus::micro_test_plus::runner_options::application_begin_
std::size_t application_begin_
The index in arguments_ of the first argument left to the application.
Definition
runner-options.h:629
micro_os_plus::micro_test_plus::runner_options::has_unknown_option
bool has_unknown_option(void) const noexcept
Checks whether an unknown option was found while parsing the command line.
Definition
runner-options-inlines.h:84
micro_os_plus::micro_test_plus::runner_options::runner_options
runner_options(void)=default
Constructs the default options.
micro_os_plus::micro_test_plus::runner_options::errors_
std::vector< std::string > errors_
The errors found while parsing the command line.
Definition
runner-options.h:600
micro_os_plus::micro_test_plus::runner_options::errors
const std::vector< std::string > & errors(void) const noexcept
Returns the errors found while parsing the command line.
Definition
runner-options-inlines.h:94
micro_os_plus::micro_test_plus::runner_options::has_errors
bool has_errors(void) const noexcept
Checks whether errors were found while parsing the command line.
Definition
runner-options-inlines.h:74
micro_os_plus::micro_test_plus::runner_options::unknown_option_
bool unknown_option_
Whether an unknown option was found.
Definition
runner-options.h:609
micro_os_plus::micro_test_plus::runner_options::operator=
runner_options & operator=(const runner_options &other)
Copy assignment operator.
Definition
runner-options-inlines.h:62
micro_os_plus::micro_test_plus::runner_options::arguments
const std::vector< std::string > & arguments(void) const noexcept
Returns the complete command line, including argv[0], if any.
Definition
runner-options-inlines.h:105
micro_os_plus::micro_test_plus::runner_options::application_arguments
std::span< const std::string > application_arguments(void) const noexcept
Returns the arguments left to the application.
Definition
runner-options-inlines.h:117
micro_os_plus::micro_test_plus::runner_options::arguments_
std::vector< std::string > arguments_
The complete command line, including argv[0], if any.
Definition
runner-options.h:619
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
inlines
runner-options-inlines.h
Generated by
1.18.0