@@ -79,18 +79,7 @@ _Example:_
7979 #define UNITY_EXCLUDE_LIMITS_H
8080
8181
82- ##### ` UNITY_EXCLUDE_SIZEOF `
83-
84- The third and final attempt to guess your types is to use the ` sizeof() `
85- operator. Even if the first two options don't work, this one covers most cases.
86- There _ is_ a rare compiler or two out there that doesn't support sizeof() in the
87- preprocessing stage, though. For these, you have the ability to disable this
88- feature as well.
89-
90- _ Example:_
91- #define UNITY_EXCLUDE_SIZEOF
92-
93- If you've disabled all of the automatic options above, you're going to have to
82+ If you've disabled both of the automatic options above, you're going to have to
9483do the configuration yourself. Don't worry. Even this isn't too bad... there are
9584just a handful of defines that you are going to specify if you don't like the
9685defaults.
@@ -127,7 +116,7 @@ _Example:_
127116 #define UNITY_POINTER_WIDTH 64
128117
129118
130- ##### ` UNITY_INCLUDE_64 `
119+ ##### ` UNITY_SUPPORT_64 `
131120
132121Unity will automatically include 64-bit support if it auto-detects it, or if
133122your ` int ` , ` long ` , or pointer widths are greater than 32-bits. Define this to
@@ -136,7 +125,7 @@ can be a significant size and speed impact to enabling 64-bit support on small
136125targets, so don't define it if you don't need it.
137126
138127_ Example:_
139- #define UNITY_INCLUDE_64
128+ #define UNITY_SUPPORT_64
140129
141130
142131### Floating Point Types
@@ -170,24 +159,20 @@ _Example:_
170159 #define UNITY_INCLUDE_DOUBLE
171160
172161
173- ##### ` UNITY_FLOAT_VERBOSE `
174-
175- ##### ` UNITY_DOUBLE_VERBOSE `
162+ ##### ` UNITY_EXCLUDE_FLOAT_PRINT `
176163
177164Unity aims for as small of a footprint as possible and avoids most standard
178- library calls (some embedded platforms don' t have a standard library!). Because
165+ library calls (some embedded platforms don’ t have a standard library!). Because
179166of this, its routines for printing integer values are minimalist and hand-coded.
180- To keep Unity universal, though, we chose to _ not_ develop our own floating
181- point print routines. Instead, the display of floating point values during a
182- failure are optional. By default, Unity will not print the actual results of
183- floating point assertion failure. So a failed assertion will produce a message
184- like ` "Values Not Within Delta" ` . If you would like verbose failure messages for
185- floating point assertions, use these options to give more explicit failure
186- messages (e.g. ` "Expected 4.56 Was 4.68" ` ). Note that this feature requires the
187- use of ` sprintf ` so might not be desirable in all cases.
167+ Therefore, the display of floating point values during a failure are optional.
168+ By default, Unity will print the actual results of floating point assertion
169+ failure (e.g. ”Expected 4.56 Was 4.68”). To not include this extra support, you
170+ can use this define to instead respond to a failed assertion with a message like
171+ ”Values Not Within Delta”. If you would like verbose failure messages for floating
172+ point assertions, use these options to give more explicit failure messages.
188173
189174_ Example:_
190- #define UNITY_DOUBLE_VERBOSE
175+ #define UNITY_EXCLUDE_FLOAT_PRINT
191176
192177
193178##### ` UNITY_FLOAT_TYPE `
@@ -277,25 +262,32 @@ will declare an instance of your function by default. If you want to disable
277262this behavior, add ` UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION ` .
278263
279264
280- ##### ` UNITY_SUPPORT_WEAK `
265+ ##### ` UNITY_WEAK_ATTRIBUTE `
266+
267+ ##### ` UNITY_WEAK_PRAGMA `
268+
269+ ##### ` UNITY_NO_WEAK `
281270
282- For some targets, Unity can make the otherwise required ` setUp() ` and
283- ` tearDown() ` functions optional. This is a nice convenience for test writers
284- since ` setUp ` and ` tearDown ` don't often actually _ do_ anything. If you're using
285- gcc or clang, this option is automatically defined for you. Other compilers can
286- also support this behavior, if they support a C feature called weak functions. A
287- weak function is a function that is compiled into your executable _ unless_ a
288- non-weak version of the same function is defined elsewhere. If a non-weak
289- version is found, the weak version is ignored as if it never existed. If your
290- compiler supports this feature, you can let Unity know by defining
291- ` UNITY_SUPPORT_WEAK ` as the function attributes that would need to be applied to
292- identify a function as weak. If your compiler lacks support for weak functions,
293- you will always need to define ` setUp ` and ` tearDown ` functions (though they can
294- be and often will be just empty). The most common options for this feature are:
271+ For some targets, Unity can make the otherwise required setUp() and tearDown()
272+ functions optional. This is a nice convenience for test writers since setUp and
273+ tearDown don’t often actually do anything. If you’re using gcc or clang, this
274+ option is automatically defined for you. Other compilers can also support this
275+ behavior, if they support a C feature called weak functions. A weak function is
276+ a function that is compiled into your executable unless a non-weak version of
277+ the same function is defined elsewhere. If a non-weak version is found, the weak
278+ version is ignored as if it never existed. If your compiler supports this feature,
279+ you can let Unity know by defining UNITY_WEAK_ATTRIBUTE or UNITY_WEAK_PRAGMA as
280+ the function attributes that would need to be applied to identify a function as
281+ weak. If your compiler lacks support for weak functions, you will always need to
282+ define setUp and tearDown functions (though they can be and often will be just
283+ empty). You can also force Unity to NOT use weak functions by defining
284+ UNITY_NO_WEAK. The most common options for this feature are:
295285
296286_ Example:_
297- #define UNITY_SUPPORT_WEAK weak
298- #define UNITY_SUPPORT_WEAK __ attribute__ ((weak))
287+ #define UNITY_WEAK_ATTRIBUTE weak
288+ #define UNITY_WEAK_ATTRIBUTE __ attribute__ ((weak))
289+ #define UNITY_WEAK_PRAGMA
290+ #define UNITY_NO_WEAK
299291
300292
301293##### ` UNITY_PTR_ATTRIBUTE `
@@ -309,6 +301,51 @@ _Example:_
309301 #define UNITY_PTR_ATTRIBUTE near
310302
311303
304+ ##### ` UNITY_PRINT_EOL `
305+
306+ By default, Unity outputs \n at the end of each line of output. This is easy
307+ to parse by the scripts, by Ceedling, etc, but it might not be ideal for YOUR
308+ system. Feel free to override this and to make it whatever you wish.
309+
310+ _ Example:_
311+ #define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n') }
312+
313+
314+
315+ ##### ` UNITY_EXCLUDE_DETAILS `
316+
317+ This is an option for if you absolutely must squeeze every byte of memory out of
318+ your system. Unity stores a set of internal scratchpads which are used to pass
319+ extra detail information around. It's used by systems like CMock in order to
320+ report which function or argument flagged an error. If you're not using CMock and
321+ you're not using these details for other things, then you can exclude them.
322+
323+ _ Example:_
324+ #define UNITY_EXCLUDE_DETAILS
325+
326+
327+
328+ ##### ` UNITY_EXCLUDE_SETJMP `
329+
330+ If your embedded system doesn't support the standard library setjmp, you can
331+ exclude Unity's reliance on this by using this define. This dropped dependence
332+ comes at a price, though. You will be unable to use custom helper functions for
333+ your tests, and you will be unable to use tools like CMock. Very likely, if your
334+ compiler doesn't support setjmp, you wouldn't have had the memory space for those
335+ things anyway, though... so this option exists for those situations.
336+
337+ _ Example:_
338+ #define UNITY_EXCLUDE_SETJMP
339+
340+ ##### ` UNITY_OUTPUT_COLOR `
341+
342+ If you want to add color using ANSI escape codes you can use this define.
343+ t
344+ _ Example:_
345+ #define UNITY_OUTPUT_COLOR
346+
347+
348+
312349## Getting Into The Guts
313350
314351There will be cases where the options above aren't quite going to get everything
0 commit comments