ESP32-basiertes Kraftort-Suchger�t mit GPS, LED-Ring und PlatformIO-Firmware.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

252 lignes
12KB

  1. /* =========================================================================
  2. Unity - A Test Framework for C
  3. ThrowTheSwitch.org
  4. Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
  5. SPDX-License-Identifier: MIT
  6. ========================================================================= */
  7. /* Unity Configuration
  8. * As of May 11th, 2016 at ThrowTheSwitch/Unity commit 837c529
  9. * Update: December 29th, 2016
  10. * See Also: Unity/docs/UnityConfigurationGuide.pdf
  11. *
  12. * Unity is designed to run on almost anything that is targeted by a C compiler.
  13. * It would be awesome if this could be done with zero configuration. While
  14. * there are some targets that come close to this dream, it is sadly not
  15. * universal. It is likely that you are going to need at least a couple of the
  16. * configuration options described in this document.
  17. *
  18. * All of Unity's configuration options are `#defines`. Most of these are simple
  19. * definitions. A couple are macros with arguments. They live inside the
  20. * unity_internals.h header file. We don't necessarily recommend opening that
  21. * file unless you really need to. That file is proof that a cross-platform
  22. * library is challenging to build. From a more positive perspective, it is also
  23. * proof that a great deal of complexity can be centralized primarily to one
  24. * place in order to provide a more consistent and simple experience elsewhere.
  25. *
  26. * Using These Options
  27. * It doesn't matter if you're using a target-specific compiler and a simulator
  28. * or a native compiler. In either case, you've got a couple choices for
  29. * configuring these options:
  30. *
  31. * 1. Because these options are specified via C defines, you can pass most of
  32. * these options to your compiler through command line compiler flags. Even
  33. * if you're using an embedded target that forces you to use their
  34. * overbearing IDE for all configuration, there will be a place somewhere in
  35. * your project to configure defines for your compiler.
  36. * 2. You can create a custom `unity_config.h` configuration file (present in
  37. * your toolchain's search paths). In this file, you will list definitions
  38. * and macros specific to your target. All you must do is define
  39. * `UNITY_INCLUDE_CONFIG_H` and Unity will rely on `unity_config.h` for any
  40. * further definitions it may need.
  41. */
  42. #ifndef UNITY_CONFIG_H
  43. #define UNITY_CONFIG_H
  44. /* ************************* AUTOMATIC INTEGER TYPES ***************************
  45. * C's concept of an integer varies from target to target. The C Standard has
  46. * rules about the `int` matching the register size of the target
  47. * microprocessor. It has rules about the `int` and how its size relates to
  48. * other integer types. An `int` on one target might be 16 bits while on another
  49. * target it might be 64. There are more specific types in compilers compliant
  50. * with C99 or later, but that's certainly not every compiler you are likely to
  51. * encounter. Therefore, Unity has a number of features for helping to adjust
  52. * itself to match your required integer sizes. It starts off by trying to do it
  53. * automatically.
  54. **************************************************************************** */
  55. /* The first attempt to guess your types is to check `limits.h`. Some compilers
  56. * that don't support `stdint.h` could include `limits.h`. If you don't
  57. * want Unity to check this file, define this to make it skip the inclusion.
  58. * Unity looks at UINT_MAX & ULONG_MAX, which were available since C89.
  59. */
  60. /* #define UNITY_EXCLUDE_LIMITS_H */
  61. /* The second thing that Unity does to guess your types is check `stdint.h`.
  62. * This file defines `UINTPTR_MAX`, since C99, that Unity can make use of to
  63. * learn about your system. It's possible you don't want it to do this or it's
  64. * possible that your system doesn't support `stdint.h`. If that's the case,
  65. * you're going to want to define this. That way, Unity will know to skip the
  66. * inclusion of this file and you won't be left with a compiler error.
  67. */
  68. /* #define UNITY_EXCLUDE_STDINT_H */
  69. /* ********************** MANUAL INTEGER TYPE DEFINITION ***********************
  70. * If you've disabled all of the automatic options above, you're going to have
  71. * to do the configuration yourself. There are just a handful of defines that
  72. * you are going to specify if you don't like the defaults.
  73. **************************************************************************** */
  74. /* Define this to be the number of bits an `int` takes up on your system. The
  75. * default, if not auto-detected, is 32 bits.
  76. *
  77. * Example:
  78. */
  79. /* #define UNITY_INT_WIDTH 16 */
  80. /* Define this to be the number of bits a `long` takes up on your system. The
  81. * default, if not autodetected, is 32 bits. This is used to figure out what
  82. * kind of 64-bit support your system can handle. Does it need to specify a
  83. * `long` or a `long long` to get a 64-bit value. On 16-bit systems, this option
  84. * is going to be ignored.
  85. *
  86. * Example:
  87. */
  88. /* #define UNITY_LONG_WIDTH 16 */
  89. /* Define this to be the number of bits a pointer takes up on your system. The
  90. * default, if not autodetected, is 32-bits. If you're getting ugly compiler
  91. * warnings about casting from pointers, this is the one to look at.
  92. *
  93. * Example:
  94. */
  95. /* #define UNITY_POINTER_WIDTH 64 */
  96. /* Unity will automatically include 64-bit support if it auto-detects it, or if
  97. * your `int`, `long`, or pointer widths are greater than 32-bits. Define this
  98. * to enable 64-bit support if none of the other options already did it for you.
  99. * There can be a significant size and speed impact to enabling 64-bit support
  100. * on small targets, so don't define it if you don't need it.
  101. */
  102. /* #define UNITY_SUPPORT_64 */
  103. /* *************************** FLOATING POINT TYPES ****************************
  104. * In the embedded world, it's not uncommon for targets to have no support for
  105. * floating point operations at all or to have support that is limited to only
  106. * single precision. We are able to guess integer sizes on the fly because
  107. * integers are always available in at least one size. Floating point, on the
  108. * other hand, is sometimes not available at all. Trying to include `float.h` on
  109. * these platforms would result in an error. This leaves manual configuration as
  110. * the only option.
  111. **************************************************************************** */
  112. /* By default, Unity guesses that you will want single precision floating point
  113. * support, but not double precision. It's easy to change either of these using
  114. * the include and exclude options here. You may include neither, just float,
  115. * or both, as suits your needs.
  116. */
  117. /* #define UNITY_EXCLUDE_FLOAT */
  118. /* #define UNITY_INCLUDE_DOUBLE */
  119. /* #define UNITY_EXCLUDE_DOUBLE */
  120. /* For features that are enabled, the following floating point options also
  121. * become available.
  122. */
  123. /* Unity aims for as small of a footprint as possible and avoids most standard
  124. * library calls (some embedded platforms don't have a standard library!).
  125. * Because of this, its routines for printing integer values are minimalist and
  126. * hand-coded. To keep Unity universal, though, we eventually chose to develop
  127. * our own floating point print routines. Still, the display of floating point
  128. * values during a failure are optional. By default, Unity will print the
  129. * actual results of floating point assertion failures. So a failed assertion
  130. * will produce a message like "Expected 4.0 Was 4.25". If you would like less
  131. * verbose failure messages for floating point assertions, use this option to
  132. * give a failure message `"Values Not Within Delta"` and trim the binary size.
  133. */
  134. /* #define UNITY_EXCLUDE_FLOAT_PRINT */
  135. /* If enabled, Unity assumes you want your `FLOAT` asserts to compare standard C
  136. * floats. If your compiler supports a specialty floating point type, you can
  137. * always override this behavior by using this definition.
  138. *
  139. * Example:
  140. */
  141. /* #define UNITY_FLOAT_TYPE float16_t */
  142. /* If enabled, Unity assumes you want your `DOUBLE` asserts to compare standard
  143. * C doubles. If you would like to change this, you can specify something else
  144. * by using this option. For example, defining `UNITY_DOUBLE_TYPE` to `long
  145. * double` could enable gargantuan floating point types on your 64-bit processor
  146. * instead of the standard `double`.
  147. *
  148. * Example:
  149. */
  150. /* #define UNITY_DOUBLE_TYPE long double */
  151. /* If you look up `UNITY_ASSERT_EQUAL_FLOAT` and `UNITY_ASSERT_EQUAL_DOUBLE` as
  152. * documented in the Unity Assertion Guide, you will learn that they are not
  153. * really asserting that two values are equal but rather that two values are
  154. * "close enough" to equal. "Close enough" is controlled by these precision
  155. * configuration options. If you are working with 32-bit floats and/or 64-bit
  156. * doubles (the normal on most processors), you should have no need to change
  157. * these options. They are both set to give you approximately 1 significant bit
  158. * in either direction. The float precision is 0.00001 while the double is
  159. * 10^-12. For further details on how this works, see the appendix of the Unity
  160. * Assertion Guide.
  161. *
  162. * Example:
  163. */
  164. /* #define UNITY_FLOAT_PRECISION 0.001f */
  165. /* #define UNITY_DOUBLE_PRECISION 0.001f */
  166. /* *************************** MISCELLANEOUS ***********************************
  167. * Miscellaneous configuration options for Unity
  168. **************************************************************************** */
  169. /* Unity uses the stddef.h header included in the C standard library for the
  170. * "NULL" macro. Define this in order to disable the include of stddef.h. If you
  171. * do this, you have to make sure to provide your own "NULL" definition.
  172. */
  173. /* #define UNITY_EXCLUDE_STDDEF_H */
  174. /* Define this to enable the unity formatted print macro:
  175. * "TEST_PRINTF"
  176. */
  177. /* #define UNITY_INCLUDE_PRINT_FORMATTED */
  178. /* *************************** TOOLSET CUSTOMIZATION ***************************
  179. * In addition to the options listed above, there are a number of other options
  180. * which will come in handy to customize Unity's behavior for your specific
  181. * toolchain. It is possible that you may not need to touch any of these but
  182. * certain platforms, particularly those running in simulators, may need to jump
  183. * through extra hoops to operate properly. These macros will help in those
  184. * situations.
  185. **************************************************************************** */
  186. /* By default, Unity prints its results to `stdout` as it runs. This works
  187. * perfectly fine in most situations where you are using a native compiler for
  188. * testing. It works on some simulators as well so long as they have `stdout`
  189. * routed back to the command line. There are times, however, where the
  190. * simulator will lack support for dumping results or you will want to route
  191. * results elsewhere for other reasons. In these cases, you should define the
  192. * `UNITY_OUTPUT_CHAR` macro. This macro accepts a single character at a time
  193. * (as an `int`, since this is the parameter type of the standard C `putchar`
  194. * function most commonly used). You may replace this with whatever function
  195. * call you like.
  196. *
  197. * Example:
  198. * Say you are forced to run your test suite on an embedded processor with no
  199. * `stdout` option. You decide to route your test result output to a custom
  200. * serial `RS232_putc()` function you wrote like thus:
  201. */
  202. /* #define UNITY_OUTPUT_CHAR(a) RS232_putc(a) */
  203. /* #define UNITY_OUTPUT_CHAR_HEADER_DECLARATION RS232_putc(int) */
  204. /* #define UNITY_OUTPUT_FLUSH() RS232_flush() */
  205. /* #define UNITY_OUTPUT_FLUSH_HEADER_DECLARATION RS232_flush(void) */
  206. /* #define UNITY_OUTPUT_START() RS232_config(115200,1,8,0) */
  207. /* #define UNITY_OUTPUT_COMPLETE() RS232_close() */
  208. /* Some compilers require a custom attribute to be assigned to pointers, like
  209. * `near` or `far`. In these cases, you can give Unity a safe default for these
  210. * by defining this option with the attribute you would like.
  211. *
  212. * Example:
  213. */
  214. /* #define UNITY_PTR_ATTRIBUTE __attribute__((far)) */
  215. /* #define UNITY_PTR_ATTRIBUTE near */
  216. /* Print execution time of each test when executed in verbose mode
  217. *
  218. * Example:
  219. *
  220. * TEST - PASS (10 ms)
  221. */
  222. /* #define UNITY_INCLUDE_EXEC_TIME */
  223. #endif /* UNITY_CONFIG_H */