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
@@ -1,93 +0,0 @@
1
-
2
- #gem install test-unit -v 1.2.3
3
- ruby_version = RUBY_VERSION.split('.')
4
- if (ruby_version[1].to_i == 9) and (ruby_version[2].to_i > 1)
5
- require 'gems'
6
- gem 'test-unit'
7
- end
8
- require 'test/unit'
9
- require 'behaviors'
10
-
11
-
12
- TESTS_ROOT = File.expand_path(File.dirname(__FILE__))
13
- SYSTEM_TEST_ROOT = TESTS_ROOT + '/system'
14
- INTEGRATION_TEST_ROOT = TESTS_ROOT + '/integration'
15
- LIB_ROOT = File.expand_path(File.dirname(__FILE__) + '/../lib')
16
- CEEDLING_ROOT = 'test_ceedling_root/'
17
- CEEDLING_LIB = 'test_ceedling_lib/'
18
- CEEDLING_VENDOR = 'test_ceedling_vendor/'
19
- CEEDLING_RELEASE = 'test_ceedling_release/'
20
-
21
- $config_options = {
22
- :project_build_root => 'project/build',
23
- :project_test_build_output_path => 'project/build/tests/output',
24
- :project_test_results_path => 'project/build/tests/results',
25
- :project_source_include_dirs => [],
26
- :project_test_file_prefix => 'test_',
27
- :project_test_preprocess_files_path => 'project/build/tests/preprocess/files',
28
- :project_test_preprocess_includes_path => 'project/build/tests/preprocess/includes',
29
- :project_test_dependencies_path => 'project/build/tests/dependencies',
30
- :test_runner_file_suffix => '_runner',
31
- :cmock_mock_prefix => 'mock_',
32
- :extension_source => '.c',
33
- :extension_header => '.h',
34
- :extension_object => '.o',
35
- :extension_executable => '.out',
36
- :extension_testpass => '.pass',
37
- :extension_dependencies => '.d',
38
- :collection_all_tests => [],
39
- :collection_all_include_paths => [],
40
- :defines_test => [],
41
- }
42
-
43
- PROJECT_BUILD_ROOT = $config_options[:project_build_root]
44
- PROJECT_TEST_BUILD_OUTPUT_PATH = $config_options[:project_test_build_output_path]
45
- PROJECT_TEST_RESULTS_PATH = $config_options[:project_test_results_path]
46
- PROJECT_SOURCE_INCLUDE_PATHS = $config_options[:project_source_include_dirs]
47
- PROJECT_TEST_FILE_PREFIX = $config_options[:project_test_file_prefix]
48
- PROJECT_TEST_PREPROCESS_FILES_PATH = $config_options[:project_test_preprocess_files_path]
49
- PROJECT_TEST_PREPROCESS_INCLUDES_PATH = $config_options[:project_test_preprocess_includes_path]
50
- PROJECT_TEST_DEPENDENCIES_PATH = $config_options[:project_test_dependencies_path]
51
- TEST_RUNNER_FILE_SUFFIX = $config_options[:test_runner_file_suffix]
52
- CMOCK_MOCK_PREFIX = $config_options[:cmock_mock_prefix]
53
- EXTENSION_SOURCE = $config_options[:extension_source]
54
- EXTENSION_HEADER = $config_options[:extension_header]
55
- EXTENSION_OBJECT = $config_options[:extension_object]
56
- EXTENSION_EXECUTABLE = $config_options[:extension_executable]
57
- EXTENSION_TESTPASS = $config_options[:extension_testpass]
58
- EXTENSION_DEPENDENCIES = $config_options[:extension_dependencies]
59
- COLLECTION_ALL_TESTS = $config_options[:collection_all_tests]
60
- COLLECTION_ALL_INCLUDE_PATHS = $config_options[:collection_all_include_paths]
61
- DEFINES_TEST = $config_options[:defines_test]
62
-
63
-
64
- class String
65
- def left_margin(margin=0)
66
- non_whitespace_column = 0
67
- new_lines = []
68
-
69
- # find first line with non-whitespace and count left columns of whitespace
70
- self.each_line do |line|
71
- if (line =~ /^\s*\S/)
72
- non_whitespace_column = $&.length - 1
73
- break
74
- end
75
- end
76
-
77
- # iterate through each line, chopping off leftmost whitespace columns and add back the desired whitespace margin
78
- self.each_line do |line|
79
- columns = []
80
- margin.times{columns << ' '}
81
- # handle special case of line being narrower than width to be lopped off
82
- if (non_whitespace_column < line.length)
83
- new_lines << "#{columns.join}#{line[non_whitespace_column..-1]}"
84
- else
85
- new_lines << "\n"
86
- end
87
- end
88
-
89
- return new_lines.join
90
- end
91
- end
92
-
93
-
@@ -1,569 +0,0 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'yaml'
3
- require 'ceedling/configurator_builder'
4
- require 'ceedling/constants' # for Verbosity constants class
5
-
6
-
7
- class ConfiguratorBuilderTest < Test::Unit::TestCase
8
-
9
- def setup
10
- objects = create_mocks(:project_config_manager, :file_system_utils, :file_wrapper)
11
- create_mocks(:file_list)
12
- @builder = ConfiguratorBuilder.new(objects)
13
- end
14
-
15
- def teardown
16
- end
17
-
18
- ############# insert tool names #############
19
-
20
- should "insert tool names into tools config from their config hash key names" do
21
- in_hash = {
22
- :tools => {
23
- :thinger => {:executable => '/bin/thinger', :arguments => ['-E']},
24
- :zinger => {:executable => 'zinger', :arguments => ['-option', '-flag']}
25
- }}
26
-
27
- @builder.populate_tool_names(in_hash)
28
-
29
- assert_equal('thinger', in_hash[:tools][:thinger][:name])
30
- assert_equal('/bin/thinger', in_hash[:tools][:thinger][:executable])
31
- assert_equal(['-E'], in_hash[:tools][:thinger][:arguments])
32
-
33
- assert_equal('zinger', in_hash[:tools][:zinger][:name])
34
- assert_equal('zinger', in_hash[:tools][:zinger][:executable])
35
- assert_equal(['-option', '-flag'], in_hash[:tools][:zinger][:arguments])
36
-
37
- end
38
-
39
- ############# flattenify #############
40
-
41
- should "flattenify keys and values contained in yaml and not blow up on empty top-level entries" do
42
-
43
- config = %Q{
44
- ---
45
- :project:
46
- :name: App
47
- :dirs:
48
- - .
49
- - gui
50
- - ../common/modules/
51
-
52
- :extension:
53
- :obj: .o
54
- :bin: .out
55
- :dep: .d
56
-
57
- :cmock:
58
- :mock_path: build/tests/mocks/
59
- :plugins:
60
- - cexception
61
- - ignore
62
-
63
- :empty:
64
-
65
- ...
66
- }.left_margin
67
- hash = @builder.flattenify( YAML.load(config) )
68
-
69
- assert_equal(hash[:project_name], 'App')
70
- assert_equal(hash[:project_dirs], ['.', 'gui', '../common/modules/'])
71
-
72
- assert_equal(hash[:extension_obj], '.o')
73
- assert_equal(hash[:extension_bin], '.out')
74
- assert_equal(hash[:extension_dep], '.d')
75
-
76
- assert_equal(hash[:cmock_mock_path], 'build/tests/mocks/')
77
- assert_equal(hash[:cmock_plugins], ['cexception', 'ignore'])
78
- end
79
-
80
- ############# defaults #############
81
-
82
- should "populate all defaults for unspecified entries in config hash" do
83
- # pass in blank configuration and ensure all defaults populated
84
- assert_equal(DEFAULT_CEEDLING_CONFIG, @builder.populate_defaults({}))
85
- end
86
-
87
- should "not default any entry in input config hash that's already been set to something" do
88
- in_hash = {
89
- # all set to something other than defaults in source
90
- :project_use_exceptions => false,
91
- :project_use_mocks => false,
92
- :project_use_preprocessor => true,
93
- :project_use_deep_dependencies => true,
94
- :project_test_file_prefix => 'yeehaw_',
95
- :project_verbosity => Verbosity::OBNOXIOUS,
96
-
97
- :paths_support => ['path/support'],
98
- :paths_include => ['path/include'],
99
-
100
- :defines_test => ['TEST_DEFINE'],
101
- :defines_source => ['SOURCE_DEFINE'],
102
-
103
- :extension_header => '.H',
104
- :extension_source => '.C',
105
- :extension_object => '.O',
106
- :extension_executable => '.exe',
107
- :extension_testpass => '.p',
108
- :extension_testfail => '.f',
109
- :extension_dependencies => '.dep',
110
-
111
- :unity_int_width => 16,
112
- :unity_exclude_float => true,
113
- :unity_float_type => 'double',
114
- :unity_float_precision => '0.0000001f',
115
-
116
- :test_runner_includes => ['Common.h'],
117
- :test_runner_file_suffix => '_walker',
118
-
119
- :tools_includes_preprocessor => {:name => 'doohicky', :executable => 'exe', :arguments => []},
120
- :tools_file_preprocessor => {:name => 'doohicky', :executable => 'exe', :arguments => []},
121
- :tools_dependencies_generator => {:name => 'doohicky', :executable => 'exe', :arguments => []},
122
- }
123
-
124
- assert_equal(in_hash, @builder.populate_defaults(in_hash))
125
- end
126
-
127
- should "merge complex/nested values within default values" do
128
- in_hash = {
129
- :tools_file_preprocessor => {:executable => '/bin/app'},
130
- :tools_dependencies_generator => {:arguments => ['-option', '-flag']}
131
- }
132
-
133
- out_hash = @builder.populate_defaults(in_hash)
134
-
135
- # default executable has been overwritten but default arguments remain
136
- assert_equal('/bin/app', out_hash[:tools_file_preprocessor][:executable])
137
- assert_equal(DEFAULT_FILE_PREPROCESSOR_TOOL[:arguments], out_hash[:tools_file_preprocessor][:arguments])
138
-
139
- # default arguments have been overwritten but default executable remains
140
- assert_equal(DEFAULT_DEPENDENCIES_GENERATOR_TOOL[:executable], out_hash[:tools_dependencies_generator][:executable])
141
- assert_equal(['-option', '-flag'], out_hash[:tools_dependencies_generator][:arguments])
142
- end
143
-
144
- should "preserve in defaulted configuration anything in input that's not a handled default" do
145
- in_hash = {
146
- :yo => 'mama',
147
- :be => 'all you can be'
148
- }
149
-
150
- assert_equal(DEFAULT_CEEDLING_CONFIG.merge(in_hash), @builder.populate_defaults(in_hash))
151
- end
152
-
153
- ############# clean #############
154
-
155
- should "tidy up configuration values" do
156
- in_hash = {
157
- :test_runner_includes => ['common', 'types.h', 'thing.H'],
158
- :extension_header => '.h',
159
- }
160
-
161
- @builder.clean(in_hash)
162
-
163
- assert_equal(['common.h', 'types.h', 'thing.h'], in_hash[:test_runner_includes])
164
- end
165
-
166
- ############# build paths #############
167
-
168
- should "construct and collect simple build paths" do
169
- in_hash = {
170
- :project_build_root => 'files/build'}
171
- expected_build_paths = [
172
- 'files/build/tests/runners',
173
- 'files/build/tests/results',
174
- 'files/build/tests/out',
175
- 'files/build/tests/artifacts',
176
- 'files/build/release/out',
177
- 'files/build/release/artifacts',]
178
-
179
- out_hash = @builder.set_build_paths(in_hash)
180
-
181
- assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
182
-
183
- assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
184
- assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
185
- assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
186
- assert_equal(expected_build_paths[3], out_hash[:project_test_artifacts_path])
187
- assert_equal(expected_build_paths[4], out_hash[:project_release_build_output_path])
188
- assert_equal(expected_build_paths[5], out_hash[:project_release_artifacts_path])
189
- end
190
-
191
- should "construct and collect build paths including mocks path" do
192
- in_hash = {
193
- :project_build_root => 'files/build',
194
- :project_use_mocks => true,
195
- :cmock_mock_path => 'files/build/tests/mocks'}
196
- expected_build_paths = [
197
- 'files/build/tests/runners',
198
- 'files/build/tests/results',
199
- 'files/build/tests/out',
200
- 'files/build/tests/mocks',
201
- 'files/build/tests/artifacts',
202
- 'files/build/release/out',
203
- 'files/build/release/artifacts',]
204
-
205
- out_hash = @builder.set_build_paths(in_hash)
206
-
207
- assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
208
-
209
- assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
210
- assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
211
- assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
212
- assert_equal(expected_build_paths[4], out_hash[:project_test_artifacts_path])
213
- assert_equal(expected_build_paths[5], out_hash[:project_release_build_output_path])
214
- assert_equal(expected_build_paths[6], out_hash[:project_release_artifacts_path])
215
- end
216
-
217
- should "construct and collect build paths including preprocessing paths" do
218
- in_hash = {
219
- :project_build_root => 'files/build',
220
- :project_use_preprocessor => true}
221
- expected_build_paths = [
222
- 'files/build/tests/runners',
223
- 'files/build/tests/results',
224
- 'files/build/tests/out',
225
- 'files/build/tests/preprocess/includes',
226
- 'files/build/tests/preprocess/files',
227
- 'files/build/temp',
228
- 'files/build/tests/artifacts',
229
- 'files/build/release/out',
230
- 'files/build/release/artifacts',]
231
-
232
- out_hash = @builder.set_build_paths(in_hash)
233
-
234
- assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
235
-
236
- assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
237
- assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
238
- assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
239
- assert_equal(expected_build_paths[3], out_hash[:project_test_preprocess_includes_path])
240
- assert_equal(expected_build_paths[4], out_hash[:project_test_preprocess_files_path])
241
- assert_equal(expected_build_paths[5], out_hash[:project_temp_path])
242
- assert_equal(expected_build_paths[6], out_hash[:project_test_artifacts_path])
243
- assert_equal(expected_build_paths[7], out_hash[:project_release_build_output_path])
244
- assert_equal(expected_build_paths[8], out_hash[:project_release_artifacts_path])
245
- end
246
-
247
- should "construct and collect build paths including dependencies paths" do
248
- in_hash = {
249
- :project_build_root => 'files/build',
250
- :project_use_deep_dependencies => true}
251
- expected_build_paths = [
252
- 'files/build/tests/runners',
253
- 'files/build/tests/results',
254
- 'files/build/tests/out',
255
- 'files/build/tests/dependencies',
256
- 'files/build/tests/artifacts',
257
- 'files/build/release/out',
258
- 'files/build/release/artifacts',]
259
-
260
- out_hash = @builder.set_build_paths(in_hash)
261
-
262
- assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
263
-
264
- assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
265
- assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
266
- assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
267
- assert_equal(expected_build_paths[3], out_hash[:project_test_dependencies_path])
268
- assert_equal(expected_build_paths[4], out_hash[:project_test_artifacts_path])
269
- assert_equal(expected_build_paths[5], out_hash[:project_release_build_output_path])
270
- assert_equal(expected_build_paths[6], out_hash[:project_release_artifacts_path])
271
- end
272
-
273
- ############# rakefile components #############
274
-
275
- should "set rakefile components needed to load the project" do
276
- in_hash = {}
277
- out_hash = @builder.set_rakefile_components(in_hash)
278
- assert_equal(
279
- ["#{CEEDLING_LIB}rules.rake",
280
- "#{CEEDLING_LIB}tasks.rake",
281
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
282
- out_hash[:project_rakefile_component_files].sort)
283
-
284
- in_hash = {:project_use_mocks => true}
285
- out_hash = @builder.set_rakefile_components(in_hash)
286
- assert_equal(
287
- ["#{CEEDLING_LIB}rules.rake",
288
- "#{CEEDLING_LIB}tasks.rake",
289
- "#{CEEDLING_LIB}rules_cmock.rake",
290
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
291
- out_hash[:project_rakefile_component_files].sort)
292
-
293
- in_hash = {:project_use_preprocessor => true}
294
- out_hash = @builder.set_rakefile_components(in_hash)
295
- assert_equal(
296
- ["#{CEEDLING_LIB}rules.rake",
297
- "#{CEEDLING_LIB}tasks.rake",
298
- "#{CEEDLING_LIB}rules_preprocess.rake",
299
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
300
- out_hash[:project_rakefile_component_files].sort)
301
-
302
- in_hash = {:project_use_deep_dependencies => true}
303
- out_hash = @builder.set_rakefile_components(in_hash)
304
- assert_equal(
305
- ["#{CEEDLING_LIB}rules.rake",
306
- "#{CEEDLING_LIB}tasks.rake",
307
- "#{CEEDLING_LIB}rules_deep_dependencies.rake",
308
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
309
- out_hash[:project_rakefile_component_files].sort)
310
-
311
- in_hash = {:project_use_mocks => true, :project_use_preprocessor => true, :project_use_deep_dependencies => true}
312
- out_hash = @builder.set_rakefile_components(in_hash)
313
- assert_equal(
314
- ["#{CEEDLING_LIB}rules.rake",
315
- "#{CEEDLING_LIB}tasks.rake",
316
- "#{CEEDLING_LIB}rules_cmock.rake",
317
- "#{CEEDLING_LIB}rules_preprocess.rake",
318
- "#{CEEDLING_LIB}rules_deep_dependencies.rake",
319
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
320
- out_hash[:project_rakefile_component_files].sort)
321
- end
322
-
323
- ############# source and test include paths #############
324
-
325
- should "collect all source and test include paths without optional mocks and exception paths" do
326
- in_hash = {
327
- :project_use_exceptions => false,
328
- :project_use_mocks => false,
329
- :paths_test => ['files/tests'],
330
- :paths_support => ['files/tests/support'],
331
- :paths_source => ['files/source'],
332
- :paths_include => ['files/source/include'],
333
- }
334
-
335
- expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src"]
336
-
337
- out_hash = @builder.collect_test_and_source_include_paths(in_hash)
338
-
339
- assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
340
- end
341
-
342
- should "collect all source and test include paths without optional mocks paths but with exception path" do
343
- in_hash = {
344
- :project_use_exceptions => true,
345
- :project_use_mocks => false,
346
- :paths_test => ['files/tests'],
347
- :paths_support => ['files/tests/support'],
348
- :paths_source => ['files/source'],
349
- :paths_include => ['files/source/include'],
350
- }
351
-
352
- expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", "#{CEEDLING_VENDOR}c_exception/lib"]
353
-
354
- out_hash = @builder.collect_test_and_source_include_paths(in_hash)
355
-
356
- assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
357
- end
358
-
359
- should "collect all source and test include paths with optional mocks paths but without exception path" do
360
- in_hash = {
361
- :project_use_exceptions => false,
362
- :project_use_mocks => true,
363
- :cmock_mock_path => 'files/build/mocks',
364
- :paths_test => ['files/tests'],
365
- :paths_support => ['files/tests/support'],
366
- :paths_source => ['files/source'],
367
- :paths_include => ['files/source/include'],
368
- }
369
-
370
- expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", 'files/build/mocks']
371
-
372
- out_hash = @builder.collect_test_and_source_include_paths(in_hash)
373
-
374
- assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
375
- end
376
-
377
- should "collect all source and test include paths with both optional mocks paths and exception path" do
378
- in_hash = {
379
- :project_use_exceptions => true,
380
- :project_use_mocks => true,
381
- :cmock_mock_path => 'files/build/mocks',
382
- :paths_test => ['files/tests'],
383
- :paths_support => ['files/tests/support'],
384
- :paths_source => ['files/source'],
385
- :paths_include => ['files/source/include'],
386
- }
387
-
388
- expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", "#{CEEDLING_VENDOR}c_exception/lib", 'files/build/mocks']
389
-
390
- out_hash = @builder.collect_test_and_source_include_paths(in_hash)
391
-
392
- assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
393
- end
394
-
395
- ############# source and test paths #############
396
-
397
- should "collect all source and test paths without optional mocks and exception paths" do
398
- in_hash = {
399
- :project_use_exceptions => false,
400
- :project_use_mocks => false,
401
- :paths_test => ['files/tests'],
402
- :paths_support => ['files/tests/support'],
403
- :paths_source => ['files/source'],
404
- :project_test_runners_path => 'files/build/runners',
405
- }
406
-
407
- expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', "#{CEEDLING_VENDOR}unity/src"]
408
-
409
- out_hash = @builder.collect_test_and_source_paths(in_hash)
410
-
411
- assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
412
- end
413
-
414
- should "collect all source and test paths with optional mocks path but without exception path" do
415
- in_hash = {
416
- :project_use_exceptions => false,
417
- :project_use_mocks => true,
418
- :paths_test => ['files/tests'],
419
- :paths_support => ['files/tests/support'],
420
- :paths_source => ['files/source'],
421
- :project_test_runners_path => 'files/build/runners',
422
- :cmock_mock_path => 'files/build/mocks',
423
- }
424
-
425
- expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', 'files/build/mocks', "#{CEEDLING_VENDOR}unity/src"]
426
-
427
- out_hash = @builder.collect_test_and_source_paths(in_hash)
428
-
429
- assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
430
- end
431
-
432
- should "collect all source and test paths without optional mocks path but with exception path" do
433
- in_hash = {
434
- :project_use_exceptions => true,
435
- :project_use_mocks => false,
436
- :paths_test => ['files/tests'],
437
- :paths_support => ['files/tests/support'],
438
- :paths_source => ['files/source'],
439
- :project_test_runners_path => 'files/build/runners',
440
- }
441
-
442
- expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', "#{CEEDLING_VENDOR}c_exception/lib", "#{CEEDLING_VENDOR}unity/src"]
443
-
444
- out_hash = @builder.collect_test_and_source_paths(in_hash)
445
-
446
- assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
447
- end
448
-
449
- should "collect all source and test paths with both optional mocks path and exception path" do
450
- in_hash = {
451
- :project_use_exceptions => true,
452
- :project_use_mocks => true,
453
- :paths_test => ['files/tests'],
454
- :paths_support => ['files/tests/support'],
455
- :paths_source => ['files/source'],
456
- :project_test_runners_path => 'files/build/runners',
457
- :cmock_mock_path => 'files/build/mocks',
458
- }
459
-
460
- expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', 'files/build/mocks', "#{CEEDLING_VENDOR}c_exception/lib", "#{CEEDLING_VENDOR}unity/src"]
461
-
462
- out_hash = @builder.collect_test_and_source_paths(in_hash)
463
-
464
- assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
465
- end
466
-
467
- ############# all tests #############
468
-
469
- should "collect all tests" do
470
- in_hash = {
471
- :paths_test => ['tests/main', 'tests/other/**'],
472
- :project_test_file_prefix => 'Test',
473
- :extension_source => '.c'}
474
-
475
- @file_wrapper.expects.instantiate_file_list.returns(@file_list)
476
-
477
- @file_list.expects.include('tests/main/Test*.c')
478
- @file_list.expects.include('tests/other/**/Test*.c')
479
-
480
- assert_equal({:collection_all_tests => @file_list}, @builder.collect_tests(in_hash))
481
- end
482
-
483
- ############# all source #############
484
-
485
- should "collect all source" do
486
- in_hash = {
487
- :paths_source => ['files/source', 'files/modules/**'],
488
- :extension_source => '.c'}
489
-
490
- @file_wrapper.expects.instantiate_file_list.returns(@file_list)
491
-
492
- @file_list.expects.include('files/source/*.c')
493
- @file_list.expects.include('files/modules/**/*.c')
494
-
495
- assert_equal({:collection_all_source => @file_list}, @builder.collect_source(in_hash))
496
- end
497
-
498
- ############# all headers #############
499
-
500
- should "collect all headers" do
501
- in_hash = {
502
- :paths_support => ['files/test/support/**'],
503
- :paths_include => ['files/source/include'],
504
- :paths_source => ['files/source', 'files/modules/**'],
505
- :extension_header => '.h'}
506
-
507
- @file_wrapper.expects.instantiate_file_list.returns(@file_list)
508
-
509
- @file_list.expects.include('files/test/support/**/*.h')
510
- @file_list.expects.include('files/source/*.h')
511
- @file_list.expects.include('files/modules/**/*.h')
512
- @file_list.expects.include('files/source/include/*.h')
513
-
514
- assert_equal({:collection_all_headers => @file_list}, @builder.collect_headers(in_hash))
515
- end
516
-
517
- ############# collect environment files #############
518
-
519
- should "collect environment source files plus project file but no user project file" do
520
- @project_config_manager.expects.main_project_filepath.returns('/home/project/config/project.yaml')
521
- @project_config_manager.expects.user_project_filepath.returns('')
522
-
523
- out_hash = @builder.collect_code_generation_dependencies
524
-
525
- assert_equal(
526
- ["#{CEEDLING_VENDOR}cmock/release/build.info",
527
- '/home/project/config/project.yaml'].sort,
528
- out_hash[:collection_code_generation_dependencies].sort)
529
- end
530
-
531
- should "collect environment source files plus project file and user project file" do
532
- @project_config_manager.expects.main_project_filepath.returns('/home/project/config/project.yaml')
533
- @project_config_manager.expects.user_project_filepath.returns('/home/project/config/user.yaml')
534
-
535
- out_hash = @builder.collect_code_generation_dependencies
536
-
537
- assert_equal(
538
- ["#{CEEDLING_VENDOR}cmock/release/build.info",
539
- '/home/project/config/project.yaml',
540
- '/home/project/config/user.yaml'].sort,
541
- out_hash[:collection_code_generation_dependencies].sort)
542
- end
543
-
544
- ############# expand path globs #############
545
-
546
- should "inspect each element of paths in config hash and expand any and all globs into a collection" do
547
-
548
- create_mocks(:paths_collection1, :paths_collection2, :paths_collection3)
549
- in_hash = {
550
- :path_dummy => [],
551
- :paths_custom => ['oh', 'yeah'],
552
- :paths_source => ['files/source', 'files/modules/**'],
553
- :paths_to_destruction => ['paths/sin', 'paths/avarice'],
554
- :whatever => 'blah blah blah',
555
- }
556
-
557
- @file_system_utils.expects.collect_paths(['oh', 'yeah']).returns(@paths_collection1)
558
- @file_system_utils.expects.collect_paths(['files/source', 'files/modules/**']).returns(@paths_collection2)
559
- @file_system_utils.expects.collect_paths(['paths/sin', 'paths/avarice']).returns(@paths_collection3)
560
-
561
- out_hash = @builder.expand_all_path_globs(in_hash)
562
-
563
- assert_equal(@paths_collection1, out_hash[:collection_paths_custom])
564
- assert_equal(@paths_collection2, out_hash[:collection_paths_source])
565
- assert_equal(@paths_collection3, out_hash[:collection_paths_to_destruction])
566
- end
567
-
568
- end
569
-