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,234 +0,0 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'configurator_helper'
3
-
4
-
5
- class ConfiguratorHelperTest < Test::Unit::TestCase
6
-
7
- def setup
8
- objects = create_mocks(:configurator_validator, :system_wrapper)
9
- @helper = ConfiguratorHelper.new(objects)
10
-
11
- @test_config = {}
12
- end
13
-
14
- def teardown
15
- end
16
-
17
-
18
- should "do nothing if no 'environment' entry in the yaml config" do
19
- @helper.set_environment_variables(@test_config)
20
- end
21
-
22
- should "set environment variables from yaml config" do
23
- @test_config[:environment] = {
24
- :cov_file => 'project/artifacts/test.cov',
25
- :TEST_NUMBER => 101,
26
- :environment_var => -2
27
- }
28
-
29
- @system_wrapper.expects.env_set('TEST_NUMBER', '101')
30
- @system_wrapper.expects.env_set('COV_FILE', 'project/artifacts/test.cov')
31
- @system_wrapper.expects.env_set('ENVIRONMENT_VAR', '-2')
32
-
33
- @helper.set_environment_variables(@test_config)
34
- end
35
-
36
-
37
- should "return true when all top-level configuration entries are present" do
38
- @configurator_validator.expects.exists?(@test_config, :project).returns(true)
39
- @configurator_validator.expects.exists?(@test_config, :paths).returns(true)
40
- @configurator_validator.expects.exists?(@test_config, :tools).returns(true)
41
-
42
- assert(@helper.validate_required_sections(@test_config))
43
- end
44
-
45
- should "fail if any top-level configuration entries are missing" do
46
-
47
- @configurator_validator.expects.exists?(@test_config, :project).returns(false)
48
- @configurator_validator.expects.exists?(@test_config, :paths).returns(true)
49
- @configurator_validator.expects.exists?(@test_config, :tools).returns(true)
50
-
51
- assert_equal(false, @helper.validate_required_sections(@test_config))
52
-
53
- @configurator_validator.expects.exists?(@test_config, :project).returns(true)
54
- @configurator_validator.expects.exists?(@test_config, :paths).returns(false)
55
- @configurator_validator.expects.exists?(@test_config, :tools).returns(true)
56
-
57
- assert_equal(false, @helper.validate_required_sections(@test_config))
58
-
59
- @configurator_validator.expects.exists?(@test_config, :project).returns(true)
60
- @configurator_validator.expects.exists?(@test_config, :paths).returns(true)
61
- @configurator_validator.expects.exists?(@test_config, :tools).returns(false)
62
-
63
- assert_equal(false, @helper.validate_required_sections(@test_config))
64
-
65
- @configurator_validator.expects.exists?(@test_config, :project).returns(false)
66
- @configurator_validator.expects.exists?(@test_config, :paths).returns(true)
67
- @configurator_validator.expects.exists?(@test_config, :tools).returns(false)
68
-
69
- assert_equal(false, @helper.validate_required_sections(@test_config))
70
- end
71
-
72
-
73
- should "return true when all required section values are present" do
74
- @configurator_validator.expects.exists?(@test_config, :project, :build_root).returns(true)
75
- @configurator_validator.expects.exists?(@test_config, :paths, :test).returns(true)
76
- @configurator_validator.expects.exists?(@test_config, :paths, :source).returns(true)
77
- @configurator_validator.expects.exists?(@test_config, :tools, :test_compiler).returns(true)
78
- @configurator_validator.expects.exists?(@test_config, :tools, :test_linker).returns(true)
79
- @configurator_validator.expects.exists?(@test_config, :tools, :test_fixture).returns(true)
80
-
81
- assert(@helper.validate_required_section_values(@test_config))
82
- end
83
-
84
- should "fail when any required section value is missing" do
85
- @configurator_validator.expects.exists?(@test_config, :project, :build_root).returns(true)
86
- @configurator_validator.expects.exists?(@test_config, :paths, :test).returns(false)
87
- @configurator_validator.expects.exists?(@test_config, :paths, :source).returns(true)
88
- @configurator_validator.expects.exists?(@test_config, :tools, :test_compiler).returns(true)
89
- @configurator_validator.expects.exists?(@test_config, :tools, :test_linker).returns(true)
90
- @configurator_validator.expects.exists?(@test_config, :tools, :test_fixture).returns(true)
91
-
92
- assert_equal(false, @helper.validate_required_section_values(@test_config))
93
-
94
- @configurator_validator.expects.exists?(@test_config, :project, :build_root).returns(false)
95
- @configurator_validator.expects.exists?(@test_config, :paths, :test).returns(true)
96
- @configurator_validator.expects.exists?(@test_config, :paths, :source).returns(true)
97
- @configurator_validator.expects.exists?(@test_config, :tools, :test_compiler).returns(true)
98
- @configurator_validator.expects.exists?(@test_config, :tools, :test_linker).returns(true)
99
- @configurator_validator.expects.exists?(@test_config, :tools, :test_fixture).returns(true)
100
-
101
- assert_equal(false, @helper.validate_required_section_values(@test_config))
102
-
103
- @configurator_validator.expects.exists?(@test_config, :project, :build_root).returns(true)
104
- @configurator_validator.expects.exists?(@test_config, :paths, :test).returns(true)
105
- @configurator_validator.expects.exists?(@test_config, :paths, :source).returns(false)
106
- @configurator_validator.expects.exists?(@test_config, :tools, :test_compiler).returns(true)
107
- @configurator_validator.expects.exists?(@test_config, :tools, :test_linker).returns(false)
108
- @configurator_validator.expects.exists?(@test_config, :tools, :test_fixture).returns(false)
109
-
110
- assert_equal(false, @helper.validate_required_section_values(@test_config))
111
- end
112
-
113
-
114
- should "fail if any paths in the configuration fail validation" do
115
- # note: source iterates through hash keys in string class's <=> order
116
- @test_config[:paths] = {:paths1 => [], :paths2 => [], :paths3 => []}
117
- @test_config[:plugins] = {:base_path => 'plugins', :enabled => ['boo', 'berry']}
118
-
119
- @configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
120
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
121
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(false)
122
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
123
- @configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
124
- @configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
125
- @configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
126
-
127
- assert_equal(false, @helper.validate_path_list(@test_config))
128
-
129
- @configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(false)
130
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
131
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
132
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
133
- @configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
134
- @configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
135
- @configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
136
-
137
- assert_equal(false, @helper.validate_path_list(@test_config))
138
-
139
- @configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
140
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(false)
141
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
142
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(false)
143
- @configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
144
- @configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
145
- @configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
146
-
147
- assert_equal(false, @helper.validate_path_list(@test_config))
148
-
149
- @configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
150
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
151
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
152
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
153
- @configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(false)
154
- @configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
155
- @configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
156
-
157
- assert_equal(false, @helper.validate_path_list(@test_config))
158
-
159
- @configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
160
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
161
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
162
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
163
- @configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
164
- @configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
165
- @configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(false)
166
-
167
- assert_equal(false, @helper.validate_path_list(@test_config))
168
- end
169
-
170
- should "successfully validate all paths in the configuration" do
171
- # note: source iterates through hash keys in string class's <=> order
172
- @test_config[:paths] = {:paths1 => [], :paths2 => [], :paths3 => []}
173
- @test_config[:plugins] = {:base_path => 'plugins', :enabled => ['boo', 'berry']}
174
-
175
- @configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
176
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
177
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
178
- @configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
179
-
180
- @configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
181
- @configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
182
- @configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
183
-
184
- assert(@helper.validate_path_list(@test_config))
185
- end
186
-
187
-
188
- should "fail if any tools in the configuration fail validation" do
189
- # note: source iterates through hash keys in string class's <=> order
190
- @test_config[:tools] = {:circular_saw => {}, :compiler => {}, :report_generator => {}}
191
-
192
- @configurator_validator.expects.exists?(@test_config, :tools, :circular_saw, :executable).returns(true)
193
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :circular_saw, :executable).returns(true)
194
- @configurator_validator.expects.exists?(@test_config, :tools, :compiler, :executable).returns(true)
195
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :compiler, :executable).returns(false)
196
- @configurator_validator.expects.exists?(@test_config, :tools, :report_generator, :executable).returns(true)
197
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :report_generator, :executable).returns(true)
198
-
199
- assert_equal(false, @helper.validate_tools(@test_config))
200
-
201
- @configurator_validator.expects.exists?(@test_config, :tools, :circular_saw, :executable).returns(false)
202
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :circular_saw, :executable).returns(true)
203
- @configurator_validator.expects.exists?(@test_config, :tools, :compiler, :executable).returns(false)
204
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :compiler, :executable).returns(true)
205
- @configurator_validator.expects.exists?(@test_config, :tools, :report_generator, :executable).returns(true)
206
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :report_generator, :executable).returns(true)
207
-
208
- assert_equal(false, @helper.validate_tools(@test_config))
209
-
210
- @configurator_validator.expects.exists?(@test_config, :tools, :circular_saw, :executable).returns(false)
211
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :circular_saw, :executable).returns(false)
212
- @configurator_validator.expects.exists?(@test_config, :tools, :compiler, :executable).returns(true)
213
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :compiler, :executable).returns(true)
214
- @configurator_validator.expects.exists?(@test_config, :tools, :report_generator, :executable).returns(false)
215
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :report_generator, :executable).returns(false)
216
-
217
- assert_equal(false, @helper.validate_tools(@test_config))
218
- end
219
-
220
- should "successfully validate tools in the configuration=" do
221
- # note: source iterates through hash keys in string class's <=> order
222
- @test_config[:tools] = {:circular_saw => {}, :compiler => {}, :report_generator => {}}
223
-
224
- @configurator_validator.expects.exists?(@test_config, :tools, :circular_saw, :executable).returns(true)
225
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :circular_saw, :executable).returns(true)
226
- @configurator_validator.expects.exists?(@test_config, :tools, :compiler, :executable).returns(true)
227
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :compiler, :executable).returns(true)
228
- @configurator_validator.expects.exists?(@test_config, :tools, :report_generator, :executable).returns(true)
229
- @configurator_validator.expects.validate_filepath(@test_config, :tools, :report_generator, :executable).returns(true)
230
-
231
- assert(@helper.validate_tools(@test_config))
232
- end
233
-
234
- end
@@ -1,232 +0,0 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'ceedling/configurator'
3
-
4
-
5
- class ConfiguratorTest < Test::Unit::TestCase
6
-
7
- def setup
8
- objects = create_mocks(:configurator_helper, :configurator_builder, :configurator_plugins, :yaml_wrapper)
9
- create_mocks(:test_hash)
10
- @configurator = Configurator.new(objects)
11
-
12
- @test_config = {}
13
- end
14
-
15
- def teardown
16
- end
17
-
18
-
19
- ############# verbosity ##############
20
-
21
- should "set project config and cmock config verbosity levels" do
22
- assert_nil(@configurator.project_config_hash[:project_verbosity])
23
- assert_nil(@configurator.cmock_config_hash[:verbosity])
24
-
25
- @configurator.set_verbosity(5)
26
-
27
- assert_equal(5, @configurator.project_config_hash[:project_verbosity])
28
- assert_equal(5, @configurator.cmock_config_hash[:verbosity])
29
- end
30
-
31
- ############# standardize paths #############
32
-
33
- should "standardize all paths" do
34
- in_hash = {
35
- :project => {:build_root => "files\\dir\\dir/"},
36
- :paths => {
37
- :yellow_brick => ["root\\subdir\\dir\\", "files/modules/tests", "source\\modules"],
38
- :destruction => ["stuff/"]
39
- },
40
- :tools => {
41
- :hammer => {:executable => "gcc"},
42
- :ratchet => {:executable => "\\bin\\cpp"}
43
- },
44
- :plugins => {:base_path => "project\\plugins"}
45
- }
46
-
47
- @configurator.standardize_paths(in_hash)
48
-
49
- assert_equal('files/dir/dir', in_hash[:project][:build_root])
50
-
51
- assert_equal(["root/subdir/dir", "files/modules/tests", "source/modules"], in_hash[:paths][:yellow_brick])
52
- assert_equal(["stuff"], in_hash[:paths][:destruction])
53
-
54
- assert_equal('gcc', in_hash[:tools][:hammer][:executable])
55
- assert_equal('/bin/cpp', in_hash[:tools][:ratchet][:executable])
56
-
57
- assert_equal('project/plugins', in_hash[:plugins][:base_path])
58
- end
59
-
60
- ############# validate ##############
61
-
62
- should "successfully validate configuration" do
63
- @configurator_helper.expects.validate_required_sections(@test_config).returns(true)
64
- @configurator_helper.expects.validate_required_section_values(@test_config).returns(true)
65
- @configurator_helper.expects.validate_paths(@test_config).returns(true)
66
- @configurator_helper.expects.validate_tools(@test_config).returns(true)
67
-
68
- @configurator.validate(@test_config)
69
- end
70
-
71
- should "immediately raise if top-level configuration entries are missing" do
72
- @configurator_helper.expects.validate_required_sections(@test_config).returns(false)
73
- assert_raise(RuntimeError) { @configurator.validate(@test_config) }
74
- end
75
-
76
- should "validate everything and complain about section values" do
77
- @configurator_helper.expects.validate_required_sections(@test_config).returns(true)
78
- @configurator_helper.expects.validate_required_section_values(@test_config).returns(false)
79
- @configurator_helper.expects.validate_paths(@test_config).returns(true)
80
- @configurator_helper.expects.validate_tools(@test_config).returns(true)
81
-
82
- assert_raise(RuntimeError) { @configurator.validate(@test_config) }
83
- end
84
-
85
- should "validate everything and complain about paths" do
86
- @configurator_helper.expects.validate_required_sections(@test_config).returns(true)
87
- @configurator_helper.expects.validate_required_section_values(@test_config).returns(true)
88
- @configurator_helper.expects.validate_paths(@test_config).returns(false)
89
- @configurator_helper.expects.validate_tools(@test_config).returns(true)
90
-
91
- assert_raise(RuntimeError) { @configurator.validate(@test_config) }
92
- end
93
-
94
- should "validate everything and complain about tools" do
95
- @configurator_helper.expects.validate_required_sections(@test_config).returns(true)
96
- @configurator_helper.expects.validate_required_section_values(@test_config).returns(true)
97
- @configurator_helper.expects.validate_paths(@test_config).returns(true)
98
- @configurator_helper.expects.validate_tools(@test_config).returns(false)
99
-
100
- assert_raise(RuntimeError) { @configurator.validate(@test_config) }
101
- end
102
-
103
- ############# insert cmock defaults ##############
104
-
105
- should "insert into provided config hash necessary default cmock settings" do
106
- config = { # no :cmock parent
107
- :project => {
108
- :build_root => 'project/build',
109
- :verbosity => 10
110
- }
111
- }
112
-
113
- expected = {
114
- :project => {
115
- :build_root => 'project/build',
116
- :verbosity => 10
117
- },
118
- :cmock => {
119
- :mock_prefix => 'Mock',
120
- :mock_path => 'project/build/tests/mocks',
121
- :enforce_strict_ordering => true,
122
- :verbosity => 10,
123
- }
124
- }
125
-
126
- @configurator.populate_cmock_defaults(config)
127
-
128
- assert_equal(expected, config)
129
- end
130
-
131
- should "not override cmock settings already in configuration hash" do
132
- config = {
133
- :project => {
134
- :verbosity => 0
135
- },
136
- :cmock => {
137
- :mock_prefix => 'mock_',
138
- :mock_path => 'foo/bar/mocks',
139
- :enforce_strict_ordering => false,
140
- :verbosity => 3,
141
- }
142
- }
143
-
144
- expected = config.clone
145
-
146
- @configurator.populate_cmock_defaults(config)
147
-
148
- assert_equal(expected, config)
149
- end
150
-
151
-
152
- ############# build configuration ##############
153
-
154
- should "build up configuration and constantize and create accessor methods from it" do
155
- # prep before hashification
156
- @configurator_builder.expects.populate_tool_names(@test_config)
157
-
158
- # set environment variables
159
- @configurator_helper.expects.set_environment_variables(@test_config)
160
-
161
- # flattenify the config object
162
- @configurator_builder.expects.flattenify(@test_config).returns(@test_hash)
163
-
164
- # insert info into configuration
165
- @configurator_builder.expects.populate_defaults(@test_hash).returns(@test_hash)
166
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
167
-
168
- # do some housekeeping
169
- @configurator_builder.expects.clean(@test_hash)
170
-
171
- # build up configuration
172
- @configurator_builder.expects.set_build_paths(@test_hash).returns(@test_hash)
173
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
174
-
175
- # build up configuration
176
- @configurator_builder.expects.set_rakefile_components(@test_hash).returns(@test_hash)
177
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
178
-
179
- # build up configuration
180
- @configurator_builder.expects.collect_test_and_source_include_paths(@test_hash).returns(@test_hash)
181
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
182
-
183
- # build up configuration
184
- @configurator_builder.expects.collect_test_and_source_paths(@test_hash).returns(@test_hash)
185
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
186
-
187
- # build up configuration
188
- @configurator_builder.expects.collect_tests(@test_hash).returns(@test_hash)
189
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
190
-
191
- # build up configuration
192
- @configurator_builder.expects.collect_source(@test_hash).returns(@test_hash)
193
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
194
-
195
- # build up configuration
196
- @configurator_builder.expects.collect_headers(@test_hash).returns(@test_hash)
197
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
198
-
199
- # build up configuration
200
- @configurator_builder.expects.collect_all_compilation_input(@test_hash).returns(@test_hash)
201
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
202
-
203
- # build up configuration
204
- @configurator_builder.expects.collect_test_defines(@test_hash).returns(@test_hash)
205
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
206
-
207
- # build up configuration
208
- @configurator_builder.expects.collect_code_generation_dependencies.returns(@test_hash)
209
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
210
-
211
- # expand paths
212
- @configurator_builder.expects.expand_all_path_globs(@test_hash).returns(@test_hash)
213
- @test_hash.expects.merge!(@test_hash).returns(@test_hash)
214
-
215
- # provide mock hash with some keys and values to constantize & add accessor methods to configurator
216
- @test_hash.expects.each_pair.yields([:test_key_1, 'test_val1'], [:test_key_2, ['foo', 'bar']])
217
- @test_hash.expects(:[], :test_key_1).returns('test_val1')
218
- @test_hash.expects(:[], :test_key_2).returns(['foo', 'bar'])
219
-
220
- assert_nil(defined?(TEST_KEY_1))
221
- assert_nil(defined?(TEST_KEY_2))
222
-
223
- @configurator.build(@test_config)
224
-
225
- assert_equal('test_val1', TEST_KEY_1)
226
- assert_equal('test_val1', @configurator.test_key_1)
227
-
228
- assert_equal(['foo', 'bar'], TEST_KEY_2)
229
- assert_equal(['foo', 'bar'], @configurator.test_key_2)
230
- end
231
-
232
- end