ceedling 0.25.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (434) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/project_as_gem.yml +13 -0
  4. data/assets/project_with_guts.yml +13 -0
  5. data/bin/ceedling +91 -67
  6. data/docs/CeedlingPacket.md +61 -23
  7. data/docs/CeedlingPacket.odt +0 -0
  8. data/docs/CeedlingPacket.pdf +0 -0
  9. data/docs/ThrowTheSwitchCodingStandard.md +207 -0
  10. data/examples/temp_sensor/test/TestTemperatureCalculator.c +4 -1
  11. data/lib/ceedling/configurator.rb +14 -1
  12. data/lib/ceedling/configurator_builder.rb +2 -1
  13. data/lib/ceedling/configurator_validator.rb +12 -3
  14. data/lib/ceedling/constants.rb +3 -1
  15. data/lib/ceedling/defaults.rb +12 -1
  16. data/lib/ceedling/file_finder.rb +3 -0
  17. data/lib/ceedling/file_path_utils.rb +1 -1
  18. data/lib/ceedling/file_wrapper.rb +4 -4
  19. data/lib/ceedling/generator.rb +12 -3
  20. data/lib/ceedling/preprocessinator_helper.rb +5 -5
  21. data/lib/ceedling/preprocessinator_includes_handler.rb +10 -1
  22. data/lib/ceedling/project_config_manager.rb +1 -2
  23. data/lib/ceedling/project_file_loader.rb +27 -9
  24. data/lib/ceedling/rakefile.rb +6 -6
  25. data/lib/ceedling/release_invoker.rb +21 -6
  26. data/lib/ceedling/rules_release.rake +9 -5
  27. data/lib/ceedling/rules_tests.rake +6 -1
  28. data/lib/ceedling/setupinator.rb +1 -0
  29. data/lib/ceedling/tasks_base.rake +3 -0
  30. data/lib/ceedling/tasks_filesystem.rake +10 -7
  31. data/lib/ceedling/tasks_release.rake +3 -1
  32. data/lib/ceedling/test_includes_extractor.rb +16 -12
  33. data/lib/ceedling/test_invoker.rb +40 -0
  34. data/lib/ceedling/version.rb +3 -3
  35. data/lib/ceedling/version.rb.erb +1 -1
  36. data/plugins/command_hooks/lib/command_hooks.rb +1 -1
  37. data/plugins/fake_function_framework/examples/fff_example/src/bar.h +1 -0
  38. data/plugins/fake_function_framework/examples/fff_example/src/event_processor.c +1 -0
  39. data/plugins/fake_function_framework/lib/fff_mock_generator.rb +4 -0
  40. data/plugins/fake_function_framework/spec/{fff_mock_generator_spec.rb → fff_mock_header_generator_spec.rb} +34 -194
  41. data/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb +149 -0
  42. data/plugins/fake_function_framework/spec/header_generator.rb +51 -0
  43. data/plugins/junit_tests_report/lib/junit_tests_report.rb +115 -0
  44. data/plugins/subprojects/README.md +63 -0
  45. data/plugins/subprojects/config/defaults.yml +33 -0
  46. data/plugins/subprojects/lib/subprojects.rb +92 -0
  47. data/plugins/subprojects/subprojects.rake +78 -0
  48. data/spec/preprocessinator_includes_handler_spec.rb +15 -5
  49. data/spec/spec_helper.rb +2 -2
  50. data/spec/spec_system_helper.rb +49 -1
  51. data/spec/system/deployment_spec.rb +29 -0
  52. data/vendor/c_exception/README.md +8 -2
  53. data/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
  54. data/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
  55. data/vendor/c_exception/vendor/unity/README.md +19 -10
  56. data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
  57. data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
  58. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
  59. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
  60. data/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
  61. data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
  62. data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
  63. data/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
  64. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
  65. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
  66. data/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  67. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  68. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  69. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  70. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  71. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  72. data/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
  73. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  74. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  75. data/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
  76. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
  77. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  78. data/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
  79. data/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
  80. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
  81. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  82. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  83. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  84. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  85. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  86. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  87. data/vendor/c_exception/vendor/unity/src/unity.c +396 -330
  88. data/vendor/c_exception/vendor/unity/src/unity.h +50 -4
  89. data/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
  90. data/vendor/c_exception/vendor/unity/test/Makefile +17 -17
  91. data/vendor/c_exception/vendor/unity/test/rakefile +63 -3
  92. data/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
  93. data/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  94. data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
  95. data/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
  96. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  97. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  98. data/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  99. data/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
  100. data/vendor/cmock/README.md +10 -1
  101. data/vendor/cmock/config/test_environment.rb +7 -7
  102. data/vendor/cmock/docs/CMock_Summary.md +325 -128
  103. data/vendor/cmock/docs/ThrowTheSwitchCodingStandard.md +207 -0
  104. data/vendor/cmock/examples/make_example/Makefile +2 -2
  105. data/vendor/cmock/examples/temp_sensor/gcc.yml +5 -4
  106. data/vendor/cmock/examples/temp_sensor/iar_v4.yml +5 -4
  107. data/vendor/cmock/examples/temp_sensor/iar_v5.yml +5 -4
  108. data/vendor/cmock/examples/temp_sensor/rakefile.rb +11 -1
  109. data/vendor/cmock/examples/temp_sensor/rakefile_helper.rb +12 -10
  110. data/vendor/cmock/lib/cmock.rb +0 -3
  111. data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +6 -2
  112. data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +2 -1
  113. data/vendor/cmock/lib/cmock_header_parser.rb +5 -6
  114. data/vendor/cmock/release/version.info +1 -1
  115. data/vendor/cmock/scripts/create_makefile.rb +4 -2
  116. data/vendor/cmock/scripts/test_summary.rb +17 -9
  117. data/vendor/cmock/src/cmock.c +1 -0
  118. data/vendor/cmock/src/cmock.h +1 -1
  119. data/vendor/cmock/src/cmock_internals.h +14 -1
  120. data/vendor/cmock/test/c/TestCMockC.yml +4 -4
  121. data/vendor/cmock/test/c/TestCMockCDynamic.yml +4 -4
  122. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_FLASH.mac +0 -0
  123. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_RAM.mac +0 -0
  124. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_SIM.mac +0 -0
  125. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_FLASH.xcl +0 -0
  126. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_RAM.xcl +0 -0
  127. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/ioat91sam7x256.ddf +0 -0
  128. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.dep +0 -0
  129. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewd +0 -0
  130. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewp +0 -0
  131. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.eww +0 -0
  132. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X-EK.h +0 -0
  133. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.inc +0 -0
  134. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.rdf +0 -0
  135. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.tcl +0 -0
  136. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256_inc.h +0 -0
  137. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/ioat91sam7x256.h +0 -0
  138. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/lib_AT91SAM7X256.h +0 -0
  139. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.cspy.bat +0 -0
  140. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dbgdt +0 -0
  141. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dni +0 -0
  142. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.wsdt +0 -0
  143. data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup.s79 +0 -0
  144. data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup_SAM7.c +0 -0
  145. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_FLASH.mac +0 -0
  146. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_RAM.mac +0 -0
  147. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_SIM.mac +0 -0
  148. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_FLASH.icf +0 -0
  149. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_RAM.icf +0 -0
  150. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.dep +0 -0
  151. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewd +0 -0
  152. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewp +0 -0
  153. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.eww +0 -0
  154. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X-EK.h +0 -0
  155. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X256_inc.h +0 -0
  156. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/lib_AT91SAM7X256.h +0 -0
  157. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/project.h +0 -0
  158. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat +0 -0
  159. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt +0 -0
  160. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dni +0 -0
  161. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.wsdt +0 -0
  162. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink +0 -0
  163. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.cspy.bat +0 -0
  164. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dbgdt +0 -0
  165. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dni +0 -0
  166. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.wsdt +0 -0
  167. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_Binary.jlink +0 -0
  168. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_FLASH_Debug.jlink +0 -0
  169. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_RAM_Debug.jlink +0 -0
  170. data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup.s +0 -0
  171. data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup_SAM7.c +0 -0
  172. data/vendor/cmock/{Rakefile → test/rakefile} +9 -9
  173. data/vendor/cmock/{rakefile_helper.rb → test/rakefile_helper.rb} +13 -13
  174. data/vendor/cmock/test/system/test_compilation/config.yml +4 -4
  175. data/vendor/cmock/test/system/test_interactions/parsing_challenges.yml +2 -0
  176. data/vendor/cmock/{targets → test/targets}/clang_strict.yml +11 -11
  177. data/vendor/cmock/{targets → test/targets}/gcc.yml +9 -9
  178. data/vendor/cmock/{targets → test/targets}/gcc_64.yml +9 -9
  179. data/vendor/cmock/{targets → test/targets}/gcc_tiny.yml +9 -9
  180. data/vendor/cmock/{targets → test/targets}/iar_arm_v4.yml +9 -9
  181. data/vendor/cmock/{targets → test/targets}/iar_arm_v5.yml +10 -10
  182. data/vendor/cmock/test/test_helper.rb +4 -8
  183. data/vendor/cmock/test/unit/cmock_config_test.rb +1 -1
  184. data/vendor/cmock/test/unit/cmock_file_writer_test.rb +1 -1
  185. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +1 -1
  186. data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +1 -1
  187. data/vendor/cmock/test/unit/cmock_generator_plugin_callback_test.rb +3 -1
  188. data/vendor/cmock/test/unit/cmock_generator_plugin_cexception_test.rb +1 -1
  189. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +1 -1
  190. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +1 -1
  191. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +1 -1
  192. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +1 -1
  193. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +1 -1
  194. data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +1 -1
  195. data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +1 -1
  196. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +15 -2
  197. data/vendor/cmock/test/unit/cmock_plugin_manager_test.rb +6 -10
  198. data/vendor/cmock/test/unit/cmock_unityhelper_parser_test.rb +1 -1
  199. data/vendor/cmock/vendor/c_exception/README.md +8 -2
  200. data/vendor/cmock/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
  201. data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
  202. data/vendor/cmock/vendor/c_exception/vendor/unity/README.md +19 -10
  203. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
  204. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
  205. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
  206. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
  207. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
  208. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
  209. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
  210. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
  211. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
  212. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
  213. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  214. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  215. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  216. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  217. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  218. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  219. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
  220. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  221. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  222. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
  223. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
  224. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  225. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
  226. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
  227. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
  228. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  229. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  230. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  231. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  232. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  233. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  234. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +396 -330
  235. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +50 -4
  236. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
  237. data/vendor/cmock/vendor/c_exception/vendor/unity/test/Makefile +17 -17
  238. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile +63 -3
  239. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
  240. data/vendor/cmock/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  241. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
  242. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
  243. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  244. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  245. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  246. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
  247. data/vendor/cmock/vendor/unity/README.md +19 -10
  248. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +67 -64
  249. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +20 -20
  250. data/vendor/cmock/vendor/unity/auto/generate_module.rb +149 -142
  251. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +234 -232
  252. data/vendor/cmock/vendor/unity/auto/parse_output.rb +220 -0
  253. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +108 -120
  254. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +11 -9
  255. data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +1 -3
  256. data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +6 -2
  257. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +45 -57
  258. data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  259. data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  260. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  261. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  262. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  263. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  264. data/vendor/cmock/vendor/unity/examples/example_1/makefile +22 -17
  265. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  266. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  267. data/vendor/cmock/vendor/unity/examples/example_2/makefile +16 -17
  268. data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +15 -15
  269. data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  270. data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +4 -10
  271. data/vendor/cmock/vendor/unity/examples/unity_config.h +14 -26
  272. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +12 -12
  273. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  274. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  275. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  276. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  277. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  278. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  279. data/vendor/cmock/vendor/unity/release/version.info +1 -1
  280. data/vendor/cmock/vendor/unity/src/unity.c +396 -330
  281. data/vendor/cmock/vendor/unity/src/unity.h +50 -4
  282. data/vendor/cmock/vendor/unity/src/unity_internals.h +119 -84
  283. data/vendor/cmock/vendor/unity/test/Makefile +17 -17
  284. data/vendor/cmock/vendor/unity/test/rakefile +63 -3
  285. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +108 -105
  286. data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  287. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +0 -6
  288. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +1 -9
  289. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  290. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  291. data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  292. data/vendor/cmock/vendor/unity/test/tests/testunity.c +1338 -151
  293. data/vendor/deep_merge/Rakefile +1 -1
  294. data/vendor/unity/README.md +19 -10
  295. data/vendor/unity/auto/colour_prompt.rb +67 -64
  296. data/vendor/unity/auto/colour_reporter.rb +20 -20
  297. data/vendor/unity/auto/generate_module.rb +149 -142
  298. data/vendor/unity/auto/generate_test_runner.rb +234 -232
  299. data/vendor/unity/auto/parse_output.rb +220 -0
  300. data/vendor/unity/auto/stylize_as_junit.rb +108 -120
  301. data/vendor/unity/auto/test_file_filter.rb +11 -9
  302. data/vendor/unity/auto/type_sanitizer.rb +1 -3
  303. data/vendor/unity/auto/unity_test_summary.py +6 -2
  304. data/vendor/unity/auto/unity_test_summary.rb +45 -57
  305. data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  306. data/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  307. data/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  308. data/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  309. data/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  310. data/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  311. data/vendor/unity/examples/example_1/makefile +22 -17
  312. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  313. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  314. data/vendor/unity/examples/example_2/makefile +16 -17
  315. data/vendor/unity/examples/example_3/rakefile.rb +15 -15
  316. data/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  317. data/vendor/unity/examples/example_3/readme.txt +4 -10
  318. data/vendor/unity/examples/unity_config.h +14 -26
  319. data/vendor/unity/extras/fixture/rakefile.rb +12 -12
  320. data/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  321. data/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  322. data/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  323. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  324. data/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  325. data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  326. data/vendor/unity/release/version.info +1 -1
  327. data/vendor/unity/src/unity.c +396 -330
  328. data/vendor/unity/src/unity.h +50 -4
  329. data/vendor/unity/src/unity_internals.h +119 -84
  330. data/vendor/unity/test/Makefile +17 -17
  331. data/vendor/unity/test/rakefile +63 -3
  332. data/vendor/unity/test/rakefile_helper.rb +108 -105
  333. data/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  334. data/vendor/unity/test/targets/clang_file.yml +0 -6
  335. data/vendor/unity/test/targets/clang_strict.yml +1 -9
  336. data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  337. data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  338. data/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  339. data/vendor/unity/test/tests/testunity.c +1338 -151
  340. metadata +102 -157
  341. data/test_graveyard/integration/paths.yml +0 -17
  342. data/test_graveyard/integration/paths_test.rb +0 -80
  343. data/test_graveyard/integration/rake_rules_aux_dependencies_test.rb +0 -75
  344. data/test_graveyard/integration/rake_rules_cmock_test.rb +0 -74
  345. data/test_graveyard/integration/rake_rules_preprocess_test.rb +0 -178
  346. data/test_graveyard/integration/rake_rules_test.rb +0 -268
  347. data/test_graveyard/integration/rake_tasks_test.rb +0 -103
  348. data/test_graveyard/integration_test_helper.rb +0 -34
  349. data/test_graveyard/rakefile_rules.rb +0 -10
  350. data/test_graveyard/rakefile_rules_aux_dependencies.rb +0 -10
  351. data/test_graveyard/rakefile_rules_cmock.rb +0 -10
  352. data/test_graveyard/rakefile_rules_preprocess.rb +0 -10
  353. data/test_graveyard/rakefile_tasks.rb +0 -10
  354. data/test_graveyard/system/file_system_dependencies.yml +0 -20
  355. data/test_graveyard/system/file_system_kitchen_sink.yml +0 -20
  356. data/test_graveyard/system/file_system_mocks.yml +0 -20
  357. data/test_graveyard/system/file_system_preprocess.yml +0 -20
  358. data/test_graveyard/system/file_system_simple.yml +0 -20
  359. data/test_graveyard/system/file_system_test.rb +0 -78
  360. data/test_graveyard/system/mocks/include/a_file.h +0 -2
  361. data/test_graveyard/system/mocks/include/other_stuff.h +0 -2
  362. data/test_graveyard/system/mocks/include/stuff.h +0 -3
  363. data/test_graveyard/system/mocks/source/a_file.c +0 -9
  364. data/test_graveyard/system/mocks/test/test_a_file.c +0 -41
  365. data/test_graveyard/system/mocks/test/test_no_file.c +0 -14
  366. data/test_graveyard/system/project_mocks.yml +0 -43
  367. data/test_graveyard/system/project_mocks_test.rb +0 -38
  368. data/test_graveyard/system/project_simple.yml +0 -36
  369. data/test_graveyard/system/project_simple_test.rb +0 -39
  370. data/test_graveyard/system/rule_mocks_test.rb +0 -44
  371. data/test_graveyard/system/rule_runners_test.rb +0 -44
  372. data/test_graveyard/system/simple/include/other_stuff.h +0 -2
  373. data/test_graveyard/system/simple/include/stuff.h +0 -3
  374. data/test_graveyard/system/simple/source/other_stuff.c +0 -6
  375. data/test_graveyard/system/simple/source/stuff.c +0 -7
  376. data/test_graveyard/system/simple/test/test_other_stuff.c +0 -30
  377. data/test_graveyard/system/simple/test/test_stuff.c +0 -51
  378. data/test_graveyard/system_test_helper.rb +0 -73
  379. data/test_graveyard/test_helper.rb +0 -93
  380. data/test_graveyard/unit/busted/configurator_builder_test.rb +0 -569
  381. data/test_graveyard/unit/busted/configurator_helper_test.rb +0 -234
  382. data/test_graveyard/unit/busted/configurator_test.rb +0 -232
  383. data/test_graveyard/unit/busted/configurator_validator_test.rb +0 -169
  384. data/test_graveyard/unit/busted/deep_merge_fix_test.rb +0 -55
  385. data/test_graveyard/unit/busted/dependinator_test.rb +0 -129
  386. data/test_graveyard/unit/busted/file_finder_helper_test.rb +0 -45
  387. data/test_graveyard/unit/busted/file_finder_test.rb +0 -114
  388. data/test_graveyard/unit/busted/file_path_utils_test.rb +0 -97
  389. data/test_graveyard/unit/busted/file_system_utils_test.rb +0 -21
  390. data/test_graveyard/unit/busted/generator_test.rb +0 -187
  391. data/test_graveyard/unit/busted/generator_test_results_test.rb +0 -129
  392. data/test_graveyard/unit/busted/generator_test_runner_test.rb +0 -475
  393. data/test_graveyard/unit/busted/preprocessinator_file_handler_test.rb +0 -39
  394. data/test_graveyard/unit/busted/preprocessinator_helper_test.rb +0 -156
  395. data/test_graveyard/unit/busted/preprocessinator_includes_handler_test.rb +0 -93
  396. data/test_graveyard/unit/busted/preprocessinator_test.rb +0 -57
  397. data/test_graveyard/unit/busted/project_file_loader_test.rb +0 -142
  398. data/test_graveyard/unit/busted/setupinator_test.rb +0 -45
  399. data/test_graveyard/unit/busted/streaminator_test.rb +0 -49
  400. data/test_graveyard/unit/busted/task_invoker_test.rb +0 -69
  401. data/test_graveyard/unit/busted/test_includes_extractor_test.rb +0 -111
  402. data/test_graveyard/unit/busted/test_invoker_helper_test.rb +0 -62
  403. data/test_graveyard/unit/busted/test_invoker_test.rb +0 -47
  404. data/test_graveyard/unit/busted/tool_executor_helper_test.rb +0 -100
  405. data/test_graveyard/unit/busted/tool_executor_test.rb +0 -351
  406. data/test_graveyard/unit/busted/verbosinator_test.rb +0 -65
  407. data/test_graveyard/unit/preprocessinator_extractor_test.rb +0 -731
  408. data/test_graveyard/unit_test_helper.rb +0 -16
  409. data/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  410. data/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  411. data/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
  412. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  413. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  414. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  415. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  416. data/vendor/cmock/docs/CMock Summary.odt +0 -0
  417. data/vendor/cmock/docs/CMock Summary.pdf +0 -0
  418. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  419. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  420. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
  421. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  422. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  423. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  424. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  425. data/vendor/cmock/vendor/unity/auto/parseOutput.rb +0 -191
  426. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  427. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  428. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  429. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  430. data/vendor/unity/auto/parseOutput.rb +0 -191
  431. data/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  432. data/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  433. data/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  434. data/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
@@ -0,0 +1,207 @@
1
+ # ThrowTheSwitch.org Coding Standard
2
+
3
+ Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part,
4
+ we try to follow these standards to unify our contributors' code into a cohesive
5
+ unit (puns intended). You might find places where these standards aren't
6
+ followed. We're not perfect. Please be polite where you notice these discrepancies
7
+ and we'll try to be polite when we notice yours.
8
+
9
+ ;)
10
+
11
+
12
+ ## Why Have A Coding Standard?
13
+
14
+ Being consistent makes code easier to understand. We've made an attempt to keep
15
+ our standard simple because we also believe that we can only expect someone to
16
+ follow something that is understandable. Please do your best.
17
+
18
+
19
+ ## Our Philosophy
20
+
21
+ Before we get into details on syntax, let's take a moment to talk about our
22
+ vision for these tools. We're C developers and embedded software developers.
23
+ These tools are great to test any C code, but catering to embedded software has
24
+ made us more tolerant of compiler quirks. There are a LOT of quirky compilers
25
+ out there. By quirky I mean "doesn't follow standards because they feel like
26
+ they have a license to do as they wish."
27
+
28
+ Our philosophy is "support every compiler we can". Most often, this means that
29
+ we aim for writing C code that is standards compliant (often C89... that seems
30
+ to be a sweet spot that is almost always compatible). But it also means these
31
+ tools are tolerant of things that aren't common. Some that aren't even
32
+ compliant. There are configuration options to override the size of standard
33
+ types. There are configuration options to force Unity to not use certain
34
+ standard library functions. A lot of Unity is configurable and we have worked
35
+ hard to make it not TOO ugly in the process.
36
+
37
+ Similarly, our tools that parse C do their best. They aren't full C parsers
38
+ (yet) and, even if they were, they would still have to accept non-standard
39
+ additions like gcc extensions or specifying `@0x1000` to force a variable to
40
+ compile to a particular location. It's just what we do, because we like
41
+ everything to Just Work™.
42
+
43
+ Speaking of having things Just Work™, that's our second philosophy. By that, we
44
+ mean that we do our best to have EVERY configuration option have a logical
45
+ default. We believe that if you're working with a simple compiler and target,
46
+ you shouldn't need to configure very much... we try to make the tools guess as
47
+ much as they can, but give the user the power to override it when it's wrong.
48
+
49
+
50
+ ## Naming Things
51
+
52
+ Let's talk about naming things. Programming is all about naming things. We name
53
+ files, functions, variables, and so much more. While we're not always going to
54
+ find the best name for something, we actually put quite a bit of effort into
55
+ finding *What Something WANTS to be Called*™.
56
+
57
+ When naming things, we more or less follow this hierarchy, the first being the
58
+ most important to us (but we do all four whenever possible):
59
+ 1. Readable
60
+ 2. Descriptive
61
+ 3. Consistent
62
+ 4. Memorable
63
+
64
+
65
+ #### Readable
66
+
67
+ We want to read our code. This means we like names and flow that are more
68
+ naturally read. We try to avoid double negatives. We try to avoid cryptic
69
+ abbreviations (sticking to ones we feel are common).
70
+
71
+
72
+ #### Descriptive
73
+
74
+ We like descriptive names for things, especially functions and variables.
75
+ Finding the right name for something is an important endeavor. You might notice
76
+ from poking around our code that this often results in names that are a little
77
+ longer than the average. Guilty. We're okay with a tiny bit more typing if it
78
+ means our code is easier to understand.
79
+
80
+ There are two exceptions to this rule that we also stick to as religiously as
81
+ possible:
82
+
83
+ First, while we realize hungarian notation (and similar systems for encoding
84
+ type information into variable names) is providing a more descriptive name, we
85
+ feel that (for the average developer) it takes away from readability and
86
+ therefore is to be avoided.
87
+
88
+ Second, loop counters and other local throw-away variables often have a purpose
89
+ which is obvious. There's no need, therefore, to get carried away with complex
90
+ naming. We find i, j, and k are better loop counters than loopCounterVar or
91
+ whatnot. We only break this rule when we see that more description could improve
92
+ understanding of an algorithm.
93
+
94
+
95
+ #### Consistent
96
+
97
+ We like consistency, but we're not really obsessed with it. We try to name our
98
+ configuration macros in a consistent fashion... you'll notice a repeated use of
99
+ UNITY_EXCLUDE_BLAH or UNITY_USES_BLAH macros. This helps users avoid having to
100
+ remember each macro's details.
101
+
102
+
103
+ #### Memorable
104
+
105
+ Where ever it doesn't violate the above principles, we try to apply memorable
106
+ names. Sometimes this means using something that is simply descriptive, but
107
+ often we strive for descriptive AND unique... we like quirky names that stand
108
+ out in our memory and are easier to search for. Take a look through the file
109
+ names in Ceedling and you'll get a good idea of what we are talking about here.
110
+ Why use preprocess when you can use preprocessinator? Or what better describes a
111
+ module in charge of invoking tasks during releases than release_invoker? Don't
112
+ get carried away. The names are still descriptive and fulfill the above
113
+ requirements, but they don't feel stale.
114
+
115
+
116
+ ## C and C++ Details
117
+
118
+ We don't really want to add to the style battles out there. Tabs or spaces?
119
+ How many spaces? Where do the braces go? These are age-old questions that will
120
+ never be answered... or at least not answered in a way that will make everyone
121
+ happy.
122
+
123
+ We've decided on our own style preferences. If you'd like to contribute to these
124
+ projects (and we hope that you do), then we ask if you do your best to follow
125
+ the same. It will only hurt a little. We promise.
126
+
127
+
128
+ #### Whitespace
129
+
130
+ Our C-style is to use spaces and to use 4 of them per indent level. It's a nice
131
+ power-of-2 number that looks decent on a wide screen. We have no more reason
132
+ than that. We break that rule when we have lines that wrap (macros or function
133
+ arguments or whatnot). When that happens, we like to indent further to line
134
+ things up in nice tidy columns.
135
+
136
+ ```C
137
+ if (stuff_happened)
138
+ {
139
+ do_something();
140
+ }
141
+ ```
142
+
143
+
144
+ #### Case
145
+
146
+ - Files - all lower case with underscores.
147
+ - Variables - all lower case with underscores
148
+ - Macros - all caps with underscores.
149
+ - Typedefs - all caps with underscores. (also ends with _T).
150
+ - Functions - camel cased. Usually named ModuleName_FuncName
151
+ - Constants and Globals - camel cased.
152
+
153
+
154
+ #### Braces
155
+
156
+ The left brace is on the next line after the declaration. The right brace is
157
+ directly below that. Everything in between in indented one level. If you're
158
+ catching an error and you have a one-line, go ahead and to it on the same line.
159
+
160
+ ```C
161
+ while (blah)
162
+ {
163
+ //Like so. Even if only one line, we use braces.
164
+ }
165
+ ```
166
+
167
+
168
+ #### Comments
169
+
170
+ Do you know what we hate? Old-school C block comments. BUT, we're using them
171
+ anyway. As we mentioned, our goal is to support every compiler we can,
172
+ especially embedded compilers. There are STILL C compilers out there that only
173
+ support old-school block comments. So that is what we're using. We apologize. We
174
+ think they are ugly too.
175
+
176
+
177
+ ## Ruby Details
178
+
179
+ Is there really such thing as a Ruby coding standard? Ruby is such a free form
180
+ language, it seems almost sacrilegious to suggest that people should comply to
181
+ one method! We'll keep it really brief!
182
+
183
+
184
+ #### Whitespace
185
+
186
+ Our Ruby style is to use spaces and to use 2 of them per indent level. It's a
187
+ nice power-of-2 number that really grooves with Ruby's compact style. We have no
188
+ more reason than that. We break that rule when we have lines that wrap. When
189
+ that happens, we like to indent further to line things up in nice tidy columns.
190
+
191
+
192
+ #### Case
193
+
194
+ - Files - all lower case with underscores.
195
+ - Variables - all lower case with underscores
196
+ - Classes, Modules, etc - Camel cased.
197
+ - Functions - all lower case with underscores
198
+ - Constants - all upper case with underscores
199
+
200
+
201
+ ## Documentation
202
+
203
+ Egad. Really? We use markdown and we like pdf files because they can be made to
204
+ look nice while still being portable. Good enough?
205
+
206
+
207
+ *Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)*
@@ -2,7 +2,7 @@ Unity Test API
2
2
  ==============
3
3
 
4
4
  [![Unity Build Status](https://api.travis-ci.org/ThrowTheSwitch/Unity.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/Unity)
5
- __Copyright (c) 2007 - 2014 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__
5
+ __Copyright (c) 2007 - 2017 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__
6
6
 
7
7
  Running Tests
8
8
  -------------
@@ -41,13 +41,13 @@ Example:
41
41
 
42
42
  main()
43
43
  {
44
- if (TEST_PROTECT() == 0)
44
+ if (TEST_PROTECT())
45
45
  {
46
46
  MyTest();
47
47
  }
48
48
  }
49
49
 
50
- If MyTest calls `TEST_ABORT`, program control will immediately return to `TEST_PROTECT` with a non-zero return value.
50
+ If MyTest calls `TEST_ABORT`, program control will immediately return to `TEST_PROTECT` with a return value of zero.
51
51
 
52
52
 
53
53
  Unity Assertion Summary
@@ -109,6 +109,18 @@ Compares two integers for equality and display errors as hexadecimal. Like the
109
109
  you can specify the size... here the size will also effect how many nibbles are shown (for example, `HEX16`
110
110
  will show 4 nibbles).
111
111
 
112
+ TEST_ASSERT_EQUAL(expected, actual)
113
+
114
+ Another way of calling TEST_ASSERT_EQUAL_INT
115
+
116
+ TEST_ASSERT_INT_WITHIN(delta, expected, actual)
117
+
118
+ Asserts that the actual value is within plus or minus delta of the expected value. This also comes in
119
+ size specific variants.
120
+
121
+ Arrays
122
+ ------
123
+
112
124
  _ARRAY
113
125
 
114
126
  You can append `_ARRAY` to any of these macros to make an array comparison of that type. Here you will
@@ -117,15 +129,12 @@ additional argument which is the number of elements to compare. For example:
117
129
 
118
130
  TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, elements)
119
131
 
120
- TEST_ASSERT_EQUAL(expected, actual)
121
-
122
- Another way of calling TEST_ASSERT_EQUAL_INT
123
-
124
- TEST_ASSERT_INT_WITHIN(delta, expected, actual)
132
+ _EACH_EQUAL
125
133
 
126
- Asserts that the actual value is within plus or minus delta of the expected value. This also comes in
127
- size specific variants.
134
+ Another array comparison option is to check that EVERY element of an array is equal to a single expected
135
+ value. You do this by specifying the EACH_EQUAL macro. For example:
128
136
 
137
+ TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, elements)
129
138
 
130
139
  Numerical Assertions: Bitwise
131
140
  -----------------------------
@@ -4,63 +4,62 @@
4
4
  # [Released under MIT License. Please refer to license.txt for details]
5
5
  # ==========================================
6
6
 
7
- if RUBY_PLATFORM =~/(win|w)32$/
8
- begin
9
- require 'Win32API'
10
- rescue LoadError
11
- puts "ERROR! \"Win32API\" library not found"
12
- puts "\"Win32API\" is required for colour on a windows machine"
13
- puts " try => \"gem install Win32API\" on the command line"
14
- puts
15
- end
16
- # puts
7
+ if RUBY_PLATFORM =~ /(win|w)32$/
8
+ begin
9
+ require 'Win32API'
10
+ rescue LoadError
11
+ puts 'ERROR! "Win32API" library not found'
12
+ puts '"Win32API" is required for colour on a windows machine'
13
+ puts ' try => "gem install Win32API" on the command line'
14
+ puts
15
+ end
16
+ # puts
17
17
  # puts 'Windows Environment Detected...'
18
- # puts 'Win32API Library Found.'
19
- # puts
18
+ # puts 'Win32API Library Found.'
19
+ # puts
20
20
  end
21
21
 
22
22
  class ColourCommandLine
23
23
  def initialize
24
- if RUBY_PLATFORM =~/(win|w)32$/
25
- get_std_handle = Win32API.new("kernel32", "GetStdHandle", ['L'], 'L')
26
- @set_console_txt_attrb =
27
- Win32API.new("kernel32","SetConsoleTextAttribute",['L','N'], 'I')
28
- @hout = get_std_handle.call(-11)
29
- end
24
+ return unless RUBY_PLATFORM =~ /(win|w)32$/
25
+ get_std_handle = Win32API.new('kernel32', 'GetStdHandle', ['L'], 'L')
26
+ @set_console_txt_attrb =
27
+ Win32API.new('kernel32', 'SetConsoleTextAttribute', %w(L N), 'I')
28
+ @hout = get_std_handle.call(-11)
30
29
  end
31
30
 
32
31
  def change_to(new_colour)
33
- if RUBY_PLATFORM =~/(win|w)32$/
34
- @set_console_txt_attrb.call(@hout,self.win32_colour(new_colour))
32
+ if RUBY_PLATFORM =~ /(win|w)32$/
33
+ @set_console_txt_attrb.call(@hout, win32_colour(new_colour))
35
34
  else
36
- "\033[30;#{posix_colour(new_colour)};22m"
37
- end
35
+ "\033[30;#{posix_colour(new_colour)};22m"
36
+ end
38
37
  end
39
38
 
40
39
  def win32_colour(colour)
41
40
  case colour
42
- when :black then 0
43
- when :dark_blue then 1
44
- when :dark_green then 2
45
- when :dark_cyan then 3
46
- when :dark_red then 4
47
- when :dark_purple then 5
48
- when :dark_yellow, :narrative then 6
49
- when :default_white, :default, :dark_white then 7
50
- when :silver then 8
51
- when :blue then 9
52
- when :green, :success then 10
53
- when :cyan, :output then 11
54
- when :red, :failure then 12
55
- when :purple then 13
56
- when :yellow then 14
57
- when :white then 15
58
- else
59
- 0
41
+ when :black then 0
42
+ when :dark_blue then 1
43
+ when :dark_green then 2
44
+ when :dark_cyan then 3
45
+ when :dark_red then 4
46
+ when :dark_purple then 5
47
+ when :dark_yellow, :narrative then 6
48
+ when :default_white, :default, :dark_white then 7
49
+ when :silver then 8
50
+ when :blue then 9
51
+ when :green, :success then 10
52
+ when :cyan, :output then 11
53
+ when :red, :failure then 12
54
+ when :purple then 13
55
+ when :yellow then 14
56
+ when :white then 15
57
+ else
58
+ 0
60
59
  end
61
60
  end
62
61
 
63
- def posix_colour(colour)
62
+ def posix_colour(colour)
64
63
  # ANSI Escape Codes - Foreground colors
65
64
  # | Code | Color |
66
65
  # | 39 | Default foreground color |
@@ -81,35 +80,39 @@ class ColourCommandLine
81
80
  # | 96 | Light cyan |
82
81
  # | 97 | White |
83
82
 
84
- case colour
85
- when :black then 30
86
- when :red, :failure then 31
87
- when :green, :success then 32
88
- when :yellow then 33
89
- when :blue, :narrative then 34
90
- when :purple, :magenta then 35
91
- when :cyan, :output then 36
92
- when :white, :default_white then 37
93
- when :default then 39
94
- else
95
- 39
83
+ case colour
84
+ when :black then 30
85
+ when :red, :failure then 31
86
+ when :green, :success then 32
87
+ when :yellow then 33
88
+ when :blue, :narrative then 34
89
+ when :purple, :magenta then 35
90
+ when :cyan, :output then 36
91
+ when :white, :default_white then 37
92
+ when :default then 39
93
+ else
94
+ 39
96
95
  end
97
96
  end
98
97
 
99
98
  def out_c(mode, colour, str)
100
99
  case RUBY_PLATFORM
101
- when /(win|w)32$/
102
- change_to(colour)
103
- $stdout.puts str if mode == :puts
104
- $stdout.print str if mode == :print
105
- change_to(:default_white)
106
- else
107
- $stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts
108
- $stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print
109
- end
100
+ when /(win|w)32$/
101
+ change_to(colour)
102
+ $stdout.puts str if mode == :puts
103
+ $stdout.print str if mode == :print
104
+ change_to(:default_white)
105
+ else
106
+ $stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts
107
+ $stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print
108
+ end
110
109
  end
111
110
  end # ColourCommandLine
112
111
 
113
- def colour_puts(role,str) ColourCommandLine.new.out_c(:puts, role, str) end
114
- def colour_print(role,str) ColourCommandLine.new.out_c(:print, role, str) end
112
+ def colour_puts(role, str)
113
+ ColourCommandLine.new.out_c(:puts, role, str)
114
+ end
115
115
 
116
+ def colour_print(role, str)
117
+ ColourCommandLine.new.out_c(:print, role, str)
118
+ end
@@ -2,38 +2,38 @@
2
2
  # Unity Project - A Test Framework for C
3
3
  # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
4
  # [Released under MIT License. Please refer to license.txt for details]
5
- # ==========================================
5
+ # ==========================================
6
6
 
7
7
  require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt"
8
8
 
9
9
  $colour_output = true
10
10
 
11
11
  def report(message)
12
- if not $colour_output
12
+ if !$colour_output
13
13
  $stdout.puts(message)
14
14
  else
15
- message = message.join('\n') if (message.class == Array)
15
+ message = message.join('\n') if message.class == Array
16
16
  message.each_line do |line|
17
17
  line.chomp!
18
- colour = case(line)
19
- when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i
20
- ($1.to_i == 0) ? :green : :red
21
- when /PASS/
22
- :green
23
- when /^OK$/
24
- :green
25
- when /(?:FAIL|ERROR)/
26
- :red
27
- when /IGNORE/
28
- :yellow
29
- when /^(?:Creating|Compiling|Linking)/
30
- :white
31
- else
32
- :silver
33
- end
18
+ colour = case line
19
+ when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i
20
+ Regexp.last_match(1).to_i.zero? ? :green : :red
21
+ when /PASS/
22
+ :green
23
+ when /^OK$/
24
+ :green
25
+ when /(?:FAIL|ERROR)/
26
+ :red
27
+ when /IGNORE/
28
+ :yellow
29
+ when /^(?:Creating|Compiling|Linking)/
30
+ :white
31
+ else
32
+ :silver
33
+ end
34
34
  colour_puts(colour, line)
35
35
  end
36
36
  end
37
37
  $stdout.flush
38
38
  $stderr.flush
39
- end
39
+ end