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
36 /**
37 * Do not run the underlying test in a debugger
38 */
40
41 /**
42 * Run the test suspended, without a debugger, and print its PID.
43 *
44 * Allows external debuggers to attach.
45 */
47
48 /**
49 * Run the test with a debugging server compatible with the compiler
50 * it was built with.
51 */
53
54 /**
55 * Run the test with gdbserver
56 */
58
59 /**
60 * Run the test with lldb-server
61 */
63
64 /**
65 * Run the test with windbg in server mode
66 */
68};
69
71 /**
72 * The current logging threshold.
73 *
74 * default: 1
75 */
77
78 /**
79 * The logger that will be used during the execution of the runner.
80 *
81 * default: normal logger
82 */
84
85 /**
86 * This option doesn't do anything and is deprecated.
87 */
89
90 /**
91 * Always return a success from criterion_run_all_tests.
92 *
93 * default: false
94 */
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 */
105
106 /**
107 * Exit immediately after the first test failure.
108 *
109 * default: false
110 */
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 */
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 */
143
144 /**
145 * Whether criterion should wait for incoming connections in server mode
146 *
147 * default: false
148 */
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 */
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 */
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 */
221
222 const char *executable_name;
223};
224
226
227/**
228 * The runtime options for the test runner.
229 */
231
233
234#endif /*!CRITERION_OPTIONS_H_ */
#define CR_BEGIN_C_API
Definition common.h:54
#define CR_API
Definition common.h:128
#define CR_END_C_API
Definition common.h:55
Logging functions.
criterion_logging_level
Definition logging.h:38