Github User Fetcher
1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h
Go to the documentation of this file.
1
/*
2
* The MIT License (MIT)
3
*
4
* Copyright © 2015-2016 Franklin "Snaipe" Mathieu <http://snai.pe/>
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to deal
8
* in the Software without restriction, including without limitation the rights
9
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
* copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
* THE SOFTWARE.
23
*/
24
/**
25
* @file
26
* @brief criterion options
27
*****************************************************************************/
28
#ifndef CRITERION_OPTIONS_H_
29
#define CRITERION_OPTIONS_H_
30
31
#include <stdbool.h>
32
#include "
logging.h
"
33
#include "
internal/common.h
"
34
35
enum
criterion_debugger
{
36
/**
37
* Do not run the underlying test in a debugger
38
*/
39
CR_DBG_NONE
,
40
41
/**
42
* Run the test suspended, without a debugger, and print its PID.
43
*
44
* Allows external debuggers to attach.
45
*/
46
CR_DBG_IDLE
,
47
48
/**
49
* Run the test with a debugging server compatible with the compiler
50
* it was built with.
51
*/
52
CR_DBG_NATIVE
,
53
54
/**
55
* Run the test with gdbserver
56
*/
57
CR_DBG_GDB
,
58
59
/**
60
* Run the test with lldb-server
61
*/
62
CR_DBG_LLDB
,
63
64
/**
65
* Run the test with windbg in server mode
66
*/
67
CR_DBG_WINDBG
,
68
};
69
70
struct
criterion_options
{
71
/**
72
* The current logging threshold.
73
*
74
* default: 1
75
*/
76
enum
criterion_logging_level
logging_threshold
;
77
78
/**
79
* The logger that will be used during the execution of the runner.
80
*
81
* default: normal logger
82
*/
83
struct
criterion_logger
*
logger
;
84
85
/**
86
* This option doesn't do anything and is deprecated.
87
*/
88
bool
no_early_exit
;
89
90
/**
91
* Always return a success from criterion_run_all_tests.
92
*
93
* default: false
94
*/
95
bool
always_succeed
;
96
97
/**
98
* Disable unicode and ansi coloring from the logging system.
99
*
100
* This is deprecated. Set the color and the encoding fields instead.
101
*
102
* default: false
103
*/
104
bool
use_ascii
;
105
106
/**
107
* Exit immediately after the first test failure.
108
*
109
* default: false
110
*/
111
bool
fail_fast
;
112
113
/**
114
* Disable all tests not matching this extglob pattern.
115
* if NULL, don't filter tests.
116
*
117
* default: NULL
118
*/
119
const
char
*
pattern
;
120
121
/**
122
* Only print the base file name compound of the source file containing
123
* the tests during reporting.
124
*
125
* default: false
126
*/
127
bool
short_filename
;
128
129
/**
130
* The maximum number of parallel jobs that the test runner will spawn.
131
* 0 means that this number shall be the number of cores on your system.
132
*
133
* default: 0
134
*/
135
size_t
jobs
;
136
137
/**
138
* Measure and report times.
139
*
140
* default: true
141
*/
142
bool
measure_time
;
143
144
/**
145
* Whether criterion should wait for incoming connections in server mode
146
*
147
* default: false
148
*/
149
bool
wait_for_clients
;
150
151
/**
152
* Raise a debug trap to crash the test if an assert fails so that a
153
* debugger can gain control.
154
*
155
* default: false
156
*/
157
bool
crash
;
158
159
/**
160
* Whether criterion should run its tests in a debugging server.
161
*
162
* The server hangs until a connection from a debugger gets accepted.
163
*
164
* This forces jobs = 1 and crash = true.
165
*
166
* default: CR_DBG_NONE;
167
*/
168
enum
criterion_debugger
debug
;
169
170
/**
171
* The TCP port of the debugging server.
172
*
173
* default: 1234
174
*/
175
unsigned
debug_port
;
176
177
/**
178
* The default timeout for each test when none is specified, in seconds.
179
*
180
* If the value is non-positive, no timeout is applied.
181
*
182
* default: 0
183
*/
184
double
timeout
;
185
186
/**
187
* Fully report statistics from test workers, including those that are
188
* not reported by default (like passing assertions).
189
*
190
* Reporting everything leads to more accurate reports at the cost of
191
* execution speed.
192
*
193
* default: false
194
*/
195
bool
full_stats
;
196
197
/**
198
* The output encoding to assume.
199
*
200
* This is used to know whether we should use special characters to
201
* make the output prettier.
202
*
203
* default: locale-deduced, or ANSI_X3.4-1968.
204
*/
205
char
encoding
[64];
206
207
/**
208
* Whether the output should be colorized or not.
209
*
210
* default: terminal-deduced.
211
*/
212
bool
color
;
213
214
/**
215
* When false, warnings will make criterion exit with a nonzero
216
* exit status (e.g. when a test crashes during its teardown).
217
*
218
* default: false
219
*/
220
bool
ignore_warnings
;
221
222
const
char
*
executable_name
;
223
};
224
225
CR_BEGIN_C_API
226
227
/**
228
* The runtime options for the test runner.
229
*/
230
CR_API
extern
struct
criterion_options
criterion_options
;
231
232
CR_END_C_API
233
234
#endif
/*!CRITERION_OPTIONS_H_ */
criterion_debugger
criterion_debugger
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:35
CR_DBG_GDB
@ CR_DBG_GDB
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:57
CR_DBG_IDLE
@ CR_DBG_IDLE
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:46
CR_DBG_NATIVE
@ CR_DBG_NATIVE
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:52
CR_DBG_LLDB
@ CR_DBG_LLDB
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:62
CR_DBG_NONE
@ CR_DBG_NONE
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:39
CR_DBG_WINDBG
@ CR_DBG_WINDBG
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:67
common.h
CR_BEGIN_C_API
#define CR_BEGIN_C_API
Definition
common.h:54
CR_API
#define CR_API
Definition
common.h:128
CR_END_C_API
#define CR_END_C_API
Definition
common.h:55
logging.h
Logging functions.
criterion_logging_level
criterion_logging_level
Definition
logging.h:38
criterion_logger
Definition
logging.h:112
criterion_options
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:70
criterion_options::debug
enum criterion_debugger debug
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:168
criterion_options::executable_name
const char * executable_name
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:222
criterion_options::wait_for_clients
bool wait_for_clients
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:149
criterion_options::timeout
double timeout
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:184
criterion_options::full_stats
bool full_stats
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:195
criterion_options::no_early_exit
bool no_early_exit
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:88
criterion_options::jobs
size_t jobs
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:135
criterion_options::logger
struct criterion_logger * logger
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:83
criterion_options::ignore_warnings
bool ignore_warnings
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:220
criterion_options::logging_threshold
enum criterion_logging_level logging_threshold
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:76
criterion_options::encoding
char encoding[64]
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:205
criterion_options::measure_time
bool measure_time
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:142
criterion_options::fail_fast
bool fail_fast
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:111
criterion_options::color
bool color
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:212
criterion_options::crash
bool crash
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:157
criterion_options::debug_port
unsigned debug_port
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:175
criterion_options::use_ascii
bool use_ascii
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:104
criterion_options::pattern
const char * pattern
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:119
criterion_options::always_succeed
bool always_succeed
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:95
criterion_options::short_filename
bool short_filename
Definition
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev/include/criterion/options.h:127
nix
store
2xpcmdrzviw89gzpf8p7l7691wk51i89-criterion-2.4.2-dev
include
criterion
options.h
Generated by
1.10.0