ceedling 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. checksums.yaml +4 -4
  2. data/GIT_COMMIT_SHA +1 -1
  3. data/README.md +1 -1
  4. data/assets/fixtures/tests_with_partials_coverage/src/private_macro.c +7 -0
  5. data/assets/fixtures/tests_with_partials_coverage/src/private_macro.h +5 -0
  6. data/assets/fixtures/tests_with_partials_coverage/src/tally.c +13 -0
  7. data/assets/fixtures/tests_with_partials_coverage/src/tally.h +4 -0
  8. data/assets/fixtures/tests_with_partials_coverage/test/test_private_macro.c +10 -0
  9. data/assets/fixtures/tests_with_partials_coverage/test/test_tally.c +9 -0
  10. data/docs/BreakingChanges.md +16 -0
  11. data/docs/Changelog.md +71 -0
  12. data/docs/KnownIssues.md +91 -4
  13. data/examples/wondrous_forest/README.md +29 -1
  14. data/examples/wondrous_forest/src/ForestUnits.h +23 -0
  15. data/examples/wondrous_forest/src/RainGauge.c +59 -0
  16. data/examples/wondrous_forest/src/RainGauge.h +39 -0
  17. data/examples/wondrous_forest/src/RainTipIsr.c +17 -0
  18. data/examples/wondrous_forest/src/RainTipIsr.h +14 -0
  19. data/examples/wondrous_forest/test/TestRainGauge.c +126 -0
  20. data/lib/ceedling/c_extractor/README.md +15 -7
  21. data/lib/ceedling/c_extractor/c_extractor.rb +25 -14
  22. data/lib/ceedling/c_extractor/c_extractor_code_text.rb +84 -54
  23. data/lib/ceedling/c_extractor/c_extractor_constants.rb +18 -7
  24. data/lib/ceedling/c_extractor/c_extractor_declarations.rb +319 -283
  25. data/lib/ceedling/c_extractor/c_extractor_declarator.rb +285 -0
  26. data/lib/ceedling/c_extractor/c_extractor_defined_type.rb +111 -0
  27. data/lib/ceedling/c_extractor/c_extractor_definitions.rb +174 -121
  28. data/lib/ceedling/c_extractor/c_extractor_functions.rb +191 -162
  29. data/lib/ceedling/c_extractor/c_extractor_preprocessing.rb +46 -55
  30. data/lib/ceedling/c_extractor/c_extractor_statement.rb +30 -0
  31. data/lib/ceedling/c_extractor/c_extractor_types.rb +63 -41
  32. data/lib/ceedling/c_extractor/c_module_edits.rb +48 -0
  33. data/lib/ceedling/c_identifier.rb +21 -0
  34. data/lib/ceedling/ceedling.h +8 -0
  35. data/lib/ceedling/config/configurator.rb +4 -3
  36. data/lib/ceedling/config/configurator_builder.rb +17 -0
  37. data/lib/ceedling/config/configurator_setup.rb +29 -5
  38. data/lib/ceedling/constants.rb +5 -1
  39. data/lib/ceedling/defaults.rb +31 -1
  40. data/lib/ceedling/dependencies/CACHE_SCHEMA.md +118 -0
  41. data/lib/ceedling/dependencies/README.md +1 -1
  42. data/lib/ceedling/dependencies/dependency_cache_store.rb +30 -25
  43. data/lib/ceedling/dependencies/dependency_tracker.rb +9 -3
  44. data/lib/ceedling/dependencies/dependinator.rb +13 -1
  45. data/lib/ceedling/diagnostics/DOCTOR.md +142 -0
  46. data/lib/ceedling/diagnostics/README.md +5 -0
  47. data/lib/ceedling/diagnostics/build_step_doctor.rb +110 -0
  48. data/lib/ceedling/diagnostics/duplicate_symbol_specialist.rb +108 -0
  49. data/lib/ceedling/diagnostics/guidance_phrases.rb +30 -0
  50. data/lib/ceedling/diagnostics/header_collision_guidance.rb +56 -0
  51. data/lib/ceedling/diagnostics/header_collision_specialist.rb +152 -0
  52. data/lib/ceedling/diagnostics/include_depth_specialist.rb +132 -0
  53. data/lib/ceedling/diagnostics/missing_symbol_specialist.rb +111 -0
  54. data/lib/ceedling/diagnostics/partial_name_specialist.rb +134 -0
  55. data/lib/ceedling/diagnostics/toolchain_output.rb +44 -0
  56. data/lib/ceedling/filesystem/PATH_HANDLING.md +83 -27
  57. data/lib/ceedling/filesystem/README.md +6 -1
  58. data/lib/ceedling/filesystem/build_roots.rb +105 -0
  59. data/lib/ceedling/filesystem/build_subpath.rb +110 -25
  60. data/lib/ceedling/filesystem/file_finder.rb +76 -110
  61. data/lib/ceedling/filesystem/file_finder_helper.rb +33 -11
  62. data/lib/ceedling/filesystem/file_path_utils.rb +113 -91
  63. data/lib/ceedling/filesystem/file_wrapper.rb +105 -28
  64. data/lib/ceedling/filesystem/path_matcher.rb +21 -0
  65. data/lib/ceedling/filesystem/test_build_layout.rb +114 -0
  66. data/lib/ceedling/filesystem/win_long_paths.rb +153 -0
  67. data/lib/ceedling/filesystem/win_path_limit.rb +83 -0
  68. data/lib/ceedling/filesystem/win_path_prober.rb +52 -0
  69. data/lib/ceedling/generators/generator.rb +27 -64
  70. data/lib/ceedling/generators/generator_helper.rb +0 -44
  71. data/lib/ceedling/generators/generator_mocks.rb +5 -0
  72. data/lib/ceedling/generators/generator_partials.rb +305 -243
  73. data/lib/ceedling/generators/generator_test_runner.rb +5 -8
  74. data/lib/ceedling/generators/partial_header_writer.rb +95 -0
  75. data/lib/ceedling/generators/partial_source_writer.rb +137 -0
  76. data/lib/ceedling/includes/header_search.rb +225 -0
  77. data/lib/ceedling/includes/include_factory.rb +9 -12
  78. data/lib/ceedling/includes/include_pathinator.rb +53 -31
  79. data/lib/ceedling/includes/includes.rb +149 -37
  80. data/lib/ceedling/objects.yml +89 -4
  81. data/lib/ceedling/partials/README.md +110 -16
  82. data/lib/ceedling/partials/carry_plan.rb +71 -0
  83. data/lib/ceedling/partials/definition_head.rb +74 -0
  84. data/lib/ceedling/partials/include_groups.rb +37 -0
  85. data/lib/ceedling/partials/interface_extras.rb +25 -0
  86. data/lib/ceedling/partials/partializer.rb +599 -120
  87. data/lib/ceedling/partials/partializer_config.rb +5 -0
  88. data/lib/ceedling/partials/partializer_helper.rb +851 -145
  89. data/lib/ceedling/partials/partializer_reconciler.rb +174 -0
  90. data/lib/ceedling/partials/partializer_utils.rb +89 -109
  91. data/lib/ceedling/partials/partials.rb +153 -10
  92. data/lib/ceedling/partials/type_macros.rb +126 -0
  93. data/lib/ceedling/preprocess/README.md +43 -33
  94. data/lib/ceedling/preprocess/preprocessinator.rb +100 -186
  95. data/lib/ceedling/preprocess/preprocessinator_code_finder.rb +65 -72
  96. data/lib/ceedling/preprocess/preprocessinator_file_assembler.rb +31 -75
  97. data/lib/ceedling/preprocess/preprocessinator_reconstructor.rb +51 -14
  98. data/lib/ceedling/setupinator.rb +16 -3
  99. data/lib/ceedling/test_invoker/HEADER_COLLISIONS.md +21 -7
  100. data/lib/ceedling/test_invoker/PIPELINE.md +57 -16
  101. data/lib/ceedling/test_invoker/README.md +1 -1
  102. data/lib/ceedling/test_invoker/derived_search_path_notices.rb +45 -0
  103. data/lib/ceedling/test_invoker/mock_locator.rb +116 -9
  104. data/lib/ceedling/test_invoker/partial_files_preprocessinator.rb +181 -0
  105. data/lib/ceedling/test_invoker/partials_manager.rb +265 -308
  106. data/lib/ceedling/test_invoker/standin_headerinator.rb +8 -15
  107. data/lib/ceedling/test_invoker/test_bare_includes_extractinator.rb +26 -3
  108. data/lib/ceedling/test_invoker/test_build_executor.rb +338 -198
  109. data/lib/ceedling/test_invoker/test_build_planner.rb +13 -19
  110. data/lib/ceedling/test_invoker/test_build_setup.rb +26 -6
  111. data/lib/ceedling/test_invoker/test_build_validations.rb +23 -20
  112. data/lib/ceedling/test_invoker/test_derived_search_paths.rb +189 -0
  113. data/lib/ceedling/test_invoker/test_file_preprocessinator.rb +1 -2
  114. data/lib/ceedling/test_invoker/test_includes_reconcilinator.rb +1 -1
  115. data/lib/ceedling/test_invoker/test_invoker_types.rb +28 -20
  116. data/lib/ceedling/test_invoker/test_pipeline_helpers.rb +5 -3
  117. data/lib/ceedling/test_invoker/test_pipeline_manager.rb +25 -8
  118. data/lib/ceedling/test_invoker/test_runner_generatinator.rb +31 -3
  119. data/lib/ceedling/test_invoker/test_search_paths.rb +30 -8
  120. data/lib/ceedling/test_invoker/test_substitutions.rb +72 -0
  121. data/lib/ceedling/tools/shell_quoting.rb +45 -0
  122. data/lib/ceedling/tools/tool_quoting.rb +79 -0
  123. data/lib/ceedling/{tool_validator.rb → tools/tool_validator.rb} +18 -7
  124. data/lib/version.rb +1 -1
  125. data/plugins/bullseye/bullseye.rake +1 -3
  126. data/plugins/bullseye/lib/bullseye.rb +15 -2
  127. data/plugins/command_hooks/lib/command_hooks.rb +1 -1
  128. data/plugins/fff/lib/fff.rb +42 -15
  129. data/plugins/fff/lib/fff_mock_generator.rb +12 -9
  130. data/plugins/fff/spec/fff_cmock_wrapper_spec.rb +134 -0
  131. data/plugins/fff/spec/fff_mock_header_generator_spec.rb +9 -0
  132. data/plugins/fff/spec/fff_mock_source_generator_spec.rb +20 -0
  133. data/plugins/gcov/lib/console_reportinator.rb +25 -19
  134. data/plugins/gcov/lib/reportgenerator_reportinator.rb +2 -1
  135. data/site-local/404.html +2 -2
  136. data/site-local/assets/javascripts/{bundle.c21346df.min.js → bundle.a5f9d56c.min.js} +1 -1
  137. data/site-local/assets/javascripts/{bundle.c21346df.min.js.map → bundle.a5f9d56c.min.js.map} +2 -2
  138. data/site-local/configuration/environment-vars.html +2 -2
  139. data/site-local/configuration/global-collections.html +3 -3
  140. data/site-local/configuration/index.html +2 -2
  141. data/site-local/configuration/loading.html +2 -2
  142. data/site-local/configuration/mixins.html +2 -2
  143. data/site-local/configuration/parallel-builds.html +2 -2
  144. data/site-local/configuration/project-file.html +2 -2
  145. data/site-local/configuration/reference/cexception.html +2 -2
  146. data/site-local/configuration/reference/cmock.html +5 -2
  147. data/site-local/configuration/reference/defines.html +2 -2
  148. data/site-local/configuration/reference/environment.html +2 -2
  149. data/site-local/configuration/reference/extension.html +2 -2
  150. data/site-local/configuration/reference/files.html +56 -9
  151. data/site-local/configuration/reference/flags.html +2 -2
  152. data/site-local/configuration/reference/index.html +2 -2
  153. data/site-local/configuration/reference/libraries.html +2 -2
  154. data/site-local/configuration/reference/mixins.html +2 -2
  155. data/site-local/configuration/reference/partials.html +84 -2
  156. data/site-local/configuration/reference/paths.html +7 -2
  157. data/site-local/configuration/reference/plugins.html +2 -2
  158. data/site-local/configuration/reference/project.html +247 -5
  159. data/site-local/configuration/reference/release-build.html +2 -2
  160. data/site-local/configuration/reference/test-build.html +2 -2
  161. data/site-local/configuration/reference/test-runner.html +2 -2
  162. data/site-local/configuration/reference/tools.html +49 -4
  163. data/site-local/configuration/reference/unity.html +2 -2
  164. data/site-local/configuration/which-ceedling.html +2 -2
  165. data/site-local/development/index.html +2 -2
  166. data/site-local/development/plugins/configuration.html +2 -2
  167. data/site-local/development/plugins/index.html +2 -2
  168. data/site-local/development/plugins/plugin-subclass.html +5 -4
  169. data/site-local/development/plugins/rake-tasks.html +2 -2
  170. data/site-local/development/releases.html +2 -2
  171. data/site-local/development/workflow.html +2 -2
  172. data/site-local/getting-started/builds.html +2 -2
  173. data/site-local/getting-started/command-line.html +2 -2
  174. data/site-local/getting-started/example-projects/cipher-quest.html +2 -2
  175. data/site-local/getting-started/example-projects/index.html +2 -2
  176. data/site-local/getting-started/example-projects/temp-sensor.html +2 -2
  177. data/site-local/getting-started/example-projects/wondrous-forest.html +10 -2
  178. data/site-local/getting-started/index.html +2 -2
  179. data/site-local/getting-started/installation.html +2 -2
  180. data/site-local/getting-started/quick-start.html +2 -2
  181. data/site-local/help.html +2 -2
  182. data/site-local/index.html +2 -2
  183. data/site-local/overview/build-system.html +2 -2
  184. data/site-local/overview/index.html +2 -2
  185. data/site-local/overview/test-environments.html +2 -2
  186. data/site-local/overview/tools-and-frameworks.html +2 -2
  187. data/site-local/plugins/beep.html +2 -2
  188. data/site-local/plugins/bullseye/index.html +45 -38
  189. data/site-local/plugins/bullseye/licensing.html +2 -2
  190. data/site-local/plugins/command-hooks.html +4 -4
  191. data/site-local/plugins/compile-commands-json-db.html +2 -2
  192. data/site-local/plugins/cppcheck.html +2 -2
  193. data/site-local/plugins/dependencies.html +2 -2
  194. data/site-local/plugins/fff.html +16 -2
  195. data/site-local/plugins/gcov/examples.html +2 -2
  196. data/site-local/plugins/gcov/gcovr.html +8 -2
  197. data/site-local/plugins/gcov/index.html +2 -2
  198. data/site-local/plugins/gcov/overview.html +2 -2
  199. data/site-local/plugins/gcov/reportgenerator.html +18 -14
  200. data/site-local/plugins/gcov/reporting.html +2 -2
  201. data/site-local/plugins/gcov/setup.html +2 -2
  202. data/site-local/plugins/gcov/tool-versions.html +2 -2
  203. data/site-local/plugins/gcov/troubleshooting.html +2 -2
  204. data/site-local/plugins/index.html +2 -2
  205. data/site-local/plugins/module-generator.html +2 -2
  206. data/site-local/plugins/report-build-warnings-log.html +2 -2
  207. data/site-local/plugins/report-tests-gtestlike-stdout.html +2 -2
  208. data/site-local/plugins/report-tests-ide-stdout.html +2 -2
  209. data/site-local/plugins/report-tests-log-factory.html +2 -2
  210. data/site-local/plugins/report-tests-pretty-stdout.html +2 -2
  211. data/site-local/plugins/report-tests-raw-output-log.html +2 -2
  212. data/site-local/plugins/report-tests-teamcity-stdout.html +2 -2
  213. data/site-local/plugins/sanitize.html +2 -2
  214. data/site-local/plugins/valgrind.html +2 -2
  215. data/site-local/project/index.html +2 -2
  216. data/site-local/project/release-history.html +2 -2
  217. data/site-local/project/sbom.html +2 -2
  218. data/site-local/project/upgrade.html +2 -2
  219. data/site-local/reference/build-directives.html +2 -2
  220. data/site-local/reference/command-line.html +2 -2
  221. data/site-local/reference/environment-vars.html +2 -2
  222. data/site-local/reference/gcov-plugin.html +2 -2
  223. data/site-local/reference/global-collections.html +12 -12
  224. data/site-local/reference/index.html +2 -2
  225. data/site-local/reference/partials-macros.html +47 -2
  226. data/site-local/reference/project-configuration.html +2 -2
  227. data/site-local/sitemap.xml.gz +0 -0
  228. data/site-local/snapshot/examples/cipher_quest/index.html +2 -2
  229. data/site-local/snapshot/examples/temp_sensor/index.html +2 -2
  230. data/site-local/snapshot/examples/wondrous_forest/index.html +72 -15
  231. data/site-local/testing-guide/build-directives.html +2 -2
  232. data/site-local/testing-guide/conventions.html +67 -22
  233. data/site-local/testing-guide/frameworks.html +2 -2
  234. data/site-local/testing-guide/index.html +2 -2
  235. data/site-local/testing-guide/partials/configuration.html +31 -4
  236. data/site-local/testing-guide/partials/conventions.html +509 -8
  237. data/site-local/testing-guide/partials/directives.html +4 -3
  238. data/site-local/testing-guide/partials/example.html +2 -2
  239. data/site-local/testing-guide/partials/index.html +2 -2
  240. data/site-local/testing-guide/partials/overview.html +30 -12
  241. data/site-local/testing-guide/partials/variables.html +169 -4
  242. data/site-local/testing-guide/test-cases.html +2 -2
  243. data/site-local/testing-guide/test-sample.html +2 -2
  244. data/site-local/testing-guide/test-suite-anatomy.html +2 -2
  245. data/spec/integration/build_step_doctor_spec.rb +270 -0
  246. data/spec/integration/c_extractor_composition_spec.rb +254 -4
  247. data/spec/integration/includes_extraction_spec.rb +27 -14
  248. data/spec/integration/nested_test_artifacts_spec.rb +1 -1
  249. data/spec/integration/partial_files_preprocessing_spec.rb +128 -0
  250. data/spec/integration/partials_carry_spec.rb +520 -0
  251. data/spec/integration/partials_declarations_spec.rb +655 -0
  252. data/spec/integration/partials_fallback_preprocessing_spec.rb +65 -0
  253. data/spec/integration/partials_function_pointers_spec.rb +277 -0
  254. data/spec/integration/partials_header_composition_spec.rb +268 -35
  255. data/spec/integration/partials_macro_decorators_spec.rb +267 -0
  256. data/spec/integration/partials_module_resolution_spec.rb +26 -19
  257. data/spec/integration/partials_symbol_linkage_spec.rb +13 -0
  258. data/spec/integration/path_length_reporting_spec.rb +64 -0
  259. data/spec/integration/path_scenarios_spec.rb +80 -3
  260. data/spec/integration/quote_include_isolator_spec.rb +56 -0
  261. data/spec/integration/test_build_parallel_barrier_spec.rb +1 -1
  262. data/spec/integration/test_includes_extractinator_spec.rb +70 -5
  263. data/spec/integration/test_naming_spec.rb +6 -3
  264. data/spec/integration/test_source_file_checks_spec.rb +5 -3
  265. data/spec/integration/tool_executor_spec.rb +1 -1
  266. data/spec/integration/tool_validator_spec.rb +2 -2
  267. data/spec/integration/win_long_paths_probe_spec.rb +46 -0
  268. data/spec/integration/win_path_limit_spec.rb +53 -0
  269. data/spec/integration/windows_registry_query_tool_spec.rb +41 -0
  270. data/spec/support/integration/configurator_integration_helper.rb +8 -3
  271. data/spec/support/integration/partial_files_harness.rb +181 -0
  272. data/spec/support/integration/partials_generation_integration_helper.rb +237 -141
  273. data/spec/support/integration/path_scenario_harness.rb +4 -2
  274. data/spec/support/integration/spec_integration_helper.rb +8 -3
  275. data/spec/support/integration/test_includes_harness.rb +56 -35
  276. data/spec/support/integration/tool_executor_integration_helper.rb +14 -2
  277. data/spec/system/bullseye_deployment_spec.rb +2 -0
  278. data/spec/system/delta_builds_spec.rb +26 -12
  279. data/spec/system/encoding_stress_spec.rb +4 -4
  280. data/spec/system/example_wondrous_forest_spec.rb +2 -2
  281. data/spec/system/gcov_deployment_spec.rb +2 -0
  282. data/spec/system/header_include_path_validation_spec.rb +4 -4
  283. data/spec/system/header_search_paths_spec.rb +1083 -0
  284. data/spec/system/mock_include_folders_spec.rb +121 -0
  285. data/spec/system/mockable_header_reassembly_spec.rb +184 -0
  286. data/spec/system/partials_carry_spec.rb +581 -0
  287. data/spec/system/partials_delta_builds_spec.rb +280 -0
  288. data/spec/system/partials_function_pointers_spec.rb +106 -0
  289. data/spec/system/partials_macro_decorators_spec.rb +127 -0
  290. data/spec/system/partials_module_disambiguation_spec.rb +125 -0
  291. data/spec/system/path_handling_probes_spec.rb +16 -12
  292. data/spec/system/pinned_thread_count_spec.rb +4 -4
  293. data/spec/system/preprocessing_fallback_conditionals_spec.rb +1 -1
  294. data/spec/system/short_build_paths_spec.rb +87 -0
  295. data/spec/system/sibling_header_collision_spec.rb +30 -6
  296. data/spec/system/support/bullseye_common_test_cases.rb +42 -0
  297. data/spec/system/support/common_test_cases.rb +2 -2
  298. data/spec/system/support/gcov_partials_test_cases.rb +48 -0
  299. data/spec/system/test_build_layout_spec.rb +209 -0
  300. data/spec/system/test_source_file_directive_spec.rb +35 -5
  301. data/spec/units/c_extractor/c_extractor_code_text_spec.rb +67 -10
  302. data/spec/units/c_extractor/c_extractor_declarations_spec.rb +501 -4
  303. data/spec/units/c_extractor/c_extractor_declarator_spec.rb +245 -0
  304. data/spec/units/c_extractor/c_extractor_defined_type_spec.rb +45 -0
  305. data/spec/units/c_extractor/c_extractor_definitions_spec.rb +163 -3
  306. data/spec/units/c_extractor/c_extractor_functions_spec.rb +462 -21
  307. data/spec/units/c_extractor/c_extractor_preprocessing_spec.rb +39 -0
  308. data/spec/units/c_extractor/c_extractor_spec.rb +4 -4
  309. data/spec/units/c_extractor/c_extractor_types_spec.rb +163 -0
  310. data/spec/units/c_identifier_spec.rb +35 -0
  311. data/spec/units/config/configurator_builder_spec.rb +24 -0
  312. data/spec/units/config/configurator_setup_spec.rb +72 -4
  313. data/spec/units/config/configurator_spec.rb +27 -1
  314. data/spec/units/dependencies/dependency_cache_store_spec.rb +68 -3
  315. data/spec/units/dependencies/dependency_tracker_spec.rb +25 -0
  316. data/spec/units/dependencies/dependinator_spec.rb +17 -2
  317. data/spec/units/diagnostics/build_step_doctor_spec.rb +170 -0
  318. data/spec/units/diagnostics/duplicate_symbol_specialist_spec.rb +117 -0
  319. data/spec/units/diagnostics/header_collision_specialist_spec.rb +267 -0
  320. data/spec/units/diagnostics/include_depth_specialist_spec.rb +137 -0
  321. data/spec/units/diagnostics/missing_symbol_specialist_spec.rb +154 -0
  322. data/spec/units/diagnostics/partial_name_specialist_spec.rb +129 -0
  323. data/spec/units/diagnostics/toolchain_output_spec.rb +86 -0
  324. data/spec/units/encodinator_spec.rb +3 -4
  325. data/spec/units/filesystem/build_roots_spec.rb +131 -0
  326. data/spec/units/filesystem/build_subpath_spec.rb +113 -0
  327. data/spec/units/filesystem/file_finder_helper_spec.rb +80 -0
  328. data/spec/units/filesystem/file_finder_spec.rb +242 -58
  329. data/spec/units/filesystem/file_path_utils_spec.rb +251 -118
  330. data/spec/units/filesystem/file_wrapper_spec.rb +191 -6
  331. data/spec/units/filesystem/path_matcher_spec.rb +36 -0
  332. data/spec/units/filesystem/test_build_layout_spec.rb +216 -0
  333. data/spec/units/filesystem/win_long_paths_spec.rb +204 -0
  334. data/spec/units/filesystem/win_path_prober_spec.rb +158 -0
  335. data/spec/units/generators/generator_helper_spec.rb +0 -60
  336. data/spec/units/generators/generator_mocks_spec.rb +13 -0
  337. data/spec/units/generators/generator_partials_spec.rb +656 -55
  338. data/spec/units/generators/generator_spec.rb +26 -0
  339. data/spec/units/generators/generator_test_runner_spec.rb +9 -5
  340. data/spec/units/generators/partial_source_writer_spec.rb +129 -0
  341. data/spec/units/includes/header_search_spec.rb +406 -0
  342. data/spec/units/includes/include_factory_spec.rb +22 -5
  343. data/spec/units/includes/include_pathinator_spec.rb +77 -13
  344. data/spec/units/includes/include_spec.rb +14 -0
  345. data/spec/units/includes/includes_spec.rb +176 -19
  346. data/spec/units/loginator_spec.rb +31 -0
  347. data/spec/units/mock_locator_spec.rb +199 -5
  348. data/spec/units/partials/include_groups_spec.rb +42 -0
  349. data/spec/units/partials/partializer_config_spec.rb +25 -0
  350. data/spec/units/partials/partializer_helper_carry_spec.rb +661 -0
  351. data/spec/units/partials/partializer_helper_interface_extras_spec.rb +396 -0
  352. data/spec/units/partials/partializer_helper_spec.rb +529 -277
  353. data/spec/units/partials/partializer_reconciler_spec.rb +661 -0
  354. data/spec/units/partials/partializer_spec.rb +1578 -270
  355. data/spec/units/partials/partializer_utils_spec.rb +269 -232
  356. data/spec/units/partials/partials_rename_spec.rb +160 -0
  357. data/spec/units/partials_manager_spec.rb +554 -261
  358. data/spec/units/plugins/bullseye_spec.rb +34 -0
  359. data/spec/units/plugins/console_reportinator_spec.rb +58 -9
  360. data/spec/units/plugins/report_tests_teamcity_stdout_spec.rb +1 -1
  361. data/spec/units/plugins/reportgenerator_reportinator_spec.rb +51 -3
  362. data/spec/units/preprocess/preprocessinator_code_finder_spec.rb +73 -10
  363. data/spec/units/preprocess/preprocessinator_file_assembler_spec.rb +125 -37
  364. data/spec/units/preprocess/preprocessinator_includes_handler_spec.rb +15 -0
  365. data/spec/units/preprocess/preprocessinator_reconstructor_spec.rb +197 -0
  366. data/spec/units/preprocess/preprocessinator_spec.rb +153 -95
  367. data/spec/units/setupinator_spec.rb +51 -0
  368. data/spec/units/standin_headerinator_spec.rb +27 -11
  369. data/spec/units/test_build_executor_spec.rb +780 -166
  370. data/spec/units/test_build_planner_spec.rb +116 -28
  371. data/spec/units/test_build_setup_spec.rb +83 -18
  372. data/spec/units/test_context_extractor_spec.rb +11 -2
  373. data/spec/units/test_derived_search_paths_spec.rb +259 -0
  374. data/spec/units/test_includes_extractinator_spec.rb +56 -8
  375. data/spec/units/test_invoker/objects_wiring_spec.rb +20 -3
  376. data/spec/units/test_invoker/partial_files_preprocessinator_spec.rb +264 -0
  377. data/spec/units/test_invoker/test_substitutions_spec.rb +122 -0
  378. data/spec/units/test_invoker_types_spec.rb +8 -7
  379. data/spec/units/test_pipeline_manager_spec.rb +54 -13
  380. data/spec/units/test_runner_generatinator_spec.rb +93 -1
  381. data/spec/units/test_search_paths_spec.rb +73 -5
  382. data/spec/units/{default_tools_quoting_spec.rb → tools/default_tools_quoting_spec.rb} +39 -5
  383. data/spec/units/tools/shell_quoting_spec.rb +76 -0
  384. data/spec/units/{tool_executor_helper_spec.rb → tools/tool_executor_helper_spec.rb} +1 -1
  385. data/spec/units/{tool_executor_spec.rb → tools/tool_executor_spec.rb} +1 -1
  386. data/spec/units/{tool_validator_spec.rb → tools/tool_validator_spec.rb} +110 -1
  387. data/spec/units/windows_registry_query_tool_spec.rb +53 -0
  388. metadata +161 -16
  389. /data/lib/ceedling/{tool_executor.rb → tools/tool_executor.rb} +0 -0
  390. /data/lib/ceedling/{tool_executor_helper.rb → tools/tool_executor_helper.rb} +0 -0
@@ -7,7 +7,6 @@
7
7
 
8
8
  require 'rubygems'
9
9
  require 'rake' # for adding ext() method to string
10
- require 'set'
11
10
  require 'ceedling/exceptions'
12
11
  require 'ceedling/filesystem/path_matcher'
13
12
  require 'ceedling/filesystem/path_mirror'
@@ -17,37 +16,23 @@ require 'ceedling/filesystem/build_subpath'
17
16
 
18
17
  class FileFinder
19
18
 
20
- constructor :configurator, :file_finder_helper, :file_path_utils, :file_wrapper, :yaml_wrapper
19
+ constructor :configurator, :file_finder_helper, :file_path_utils, :file_wrapper, :yaml_wrapper, :test_build_layout
21
20
 
22
21
  def setup
23
22
  @test_names_lock = Mutex.new
24
23
  end
25
24
 
26
25
 
27
- # `collection`, when given, is a caller's own already-ordered, per-test header list
28
- # (see IncludePathinator#ordered_header_files) reflecting that one test's real search-path
29
- # priority -- TEST_INCLUDE_PATH() ranked ahead of :support/:include, as a real compile would
30
- # see it. Absent that (a caller with no single test in view, e.g. Partializer resolving a
31
- # module generically), the project-wide collection_all_headers is the only sensible fallback.
26
+ # `collection`, when given, is a test's HeaderSearch (see IncludePathinator#header_search),
27
+ # which finds the header through that test's search paths as its compiler would, or a
28
+ # caller's own ordered header list. Absent either, the project-wide collection_all_headers
29
+ # is the fallback.
32
30
  # `complain` sets what a missing header does: :error raises, and :warn or :ignore
33
31
  # returns nil. A header matching only in letter case raises under all three; :silent
34
32
  # returns nil for that too.
35
33
  def find_header_input_for_mock(mock, collection: nil, complain: :error)
36
- # Mock name/path => <mock prefix><header filename (.h)>, optionally preceded by however
37
- # much path the #include itself carried (e.g. 'Mockfoo.h' or 'drivers/Mockfoo.h').
38
- # Note: In some rare cases, a mock name may include a dot (ex. Sensor.44) because of versioning file naming convention
39
- # Be careful about assuming the end of the name has any sort of file extension
40
- #
41
- # Stripping the mock prefix from only the basename -- not the whole query -- preserves
42
- # whatever disambiguating path the #include carried, so a query with a path is matched
43
- # exactly as specifically as it was written, not collapsed to a bare basename that would
44
- # throw away real disambiguating information.
45
- dir = File.dirname(mock)
46
- basename = File.basename(mock).delete_prefix(@configurator.cmock_mock_prefix)
47
- header = dir == '.' ? basename : File.join(dir, basename)
48
-
49
34
  found_path = @file_finder_helper.resolve_file_in_collection(
50
- header,
35
+ mock_header_query(mock),
51
36
  collection || @configurator.collection_all_headers,
52
37
  complain
53
38
  )
@@ -55,6 +40,16 @@ class FileFinder
55
40
  return found_path
56
41
  end
57
42
 
43
+ # The header a mock's #include names, as in 'Mockfoo.h' or 'drivers/Mockfoo.h'. The mock
44
+ # prefix drops from the filename alone, so the path the #include carried stays in the
45
+ # query. A mock name may hold a dot (Sensor.44) by a versioning convention, so nothing
46
+ # here assumes the name ends in an extension.
47
+ def mock_header_query(mock)
48
+ dir = File.dirname(mock)
49
+ basename = File.basename(mock).delete_prefix(@configurator.cmock_mock_prefix)
50
+ return dir == '.' ? basename : File.join(dir, basename)
51
+ end
52
+
58
53
  # A mock's real header and its own mirrored subdirectory below whichever configured
59
54
  # :test/:support/:include root contains it -- the same roots collection_all_headers is
60
55
  # built from. Combined into one call since every caller needing the mirrored subdirectory
@@ -95,14 +90,15 @@ class FileFinder
95
90
  # Extract filename without file extension
96
91
  source_file = File.basename(filepath).ext('')
97
92
 
98
- # Recovered once and reused by every branch below that needs it, rather than each
99
- # independently re-deriving the same test identity from the same filepath. Prefers the
100
- # caller's own explicitly-known test identity over inferring it from the filepath's own
101
- # structure -- inference only works when a context's own object paths are mirrored under
102
- # a per-test subdirectory (the :test context is; GCOV and Bullseye's own flat, project-wide
103
- # object paths are not), so a context lacking that structure would otherwise never recover
104
- # a test identity at all.
105
- test_context = test ? test.to_s : test_context_of(filepath)
93
+ # Recovered once and reused by every branch below that needs it. The caller's own test
94
+ # comes first. Without one, a build file's own place in the test build layout names its
95
+ # test exactly, and a source-tree query, from an #include or TEST_SOURCE_FILE(), names none.
96
+ test_context = test ? test.to_s : test_context_of(filepath, context)
97
+
98
+ # A test's generated mocks and Partials sit below its own roots, which only a known test
99
+ # has. Without one these branches search nothing, so a query never finds another test's.
100
+ mocks_root = release ? nil : @test_build_layout.root( :mocks, test_context )
101
+ partials_root = release ? nil : @test_build_layout.root( :partials, test_context )
106
102
 
107
103
  # We only collect files that already exist when we start up.
108
104
  # FileLists can produce undesired results for dynamically generated files depending on when they're accessed.
@@ -113,6 +109,11 @@ class FileFinder
113
109
  # Some legacy files can include naming conventions like <name>.##.<ext> for versioning.
114
110
  # If we use .ext() below we'll clobber the dotted portion of the filename
115
111
 
112
+ # The name and the files a mock or Partial branch below searched. A hand-written source may
113
+ # take a generated file's name, so a miss there falls through to the build's sources. A miss
114
+ # of both complains of the generated file.
115
+ generated = nil
116
+
116
117
  # Generated test runners -- searched for in the runners directory of this test's name,
117
118
  # so two same-named tests' runners are never mistaken for each other
118
119
  if (!release) and
@@ -128,47 +129,49 @@ class FileFinder
128
129
  @file_wrapper.directory_listing( FilePathUtils.glob(runner_scope_dir(test_context), '*') ),
129
130
  complain)
130
131
 
131
- # Generated mocks -- scoped to this test's own mock subtree so another test's
132
+ # Generated mocks -- scoped to this test's own mock root so another test's
132
133
  # identically named mock (expected, routine repetition) is never mistaken for ambiguity
133
- elsif (!release) and
134
+ elsif !mocks_root.nil? and
134
135
  (source_file.start_with?( @configurator.cmock_mock_prefix ))
135
136
  # A mock mirrors the directory of whatever it mocks, so two same-named headers
136
137
  # mocked in one test -- two modules mocked as Partials by directory, say -- are
137
138
  # told apart only by that subdirectory. Measured the same way a generated
138
139
  # Partial's is, below.
139
- mocks_root = File.join(@configurator.cmock_mock_path, test_context)
140
- subdir = generated_file_subdir( filepath, mocks_root, test: test, context: context )
140
+ subdir = generated_file_subdir( filepath, mocks_root, test: test_context, context: context )
141
141
 
142
142
  _source_file = source_file + EXTENSION_CORE_SOURCE
143
143
  _source_file = File.join( subdir, _source_file ) unless subdir.empty?
144
+ collection = own_generated_files( mocks_root )
144
145
 
145
- found_file =
146
- @file_finder_helper.find_file_in_collection(
147
- _source_file,
148
- own_generated_files( @configurator.cmock_mock_path, test_context ),
149
- complain)
146
+ # The mock at exactly this place below the root comes first, since a same-named mock
147
+ # deeper down, such as one an earlier build left, ends with the same folder and name.
148
+ # A flat object path names no subdirectory, so the name alone still finds a mock
149
+ # anywhere below the root.
150
+ exact = ProjectPaths.segments( File.join( mocks_root, _source_file ) )
151
+ found_file = collection.find { |file| ProjectPaths.segments( file ) == exact }
152
+ found_file ||= @file_finder_helper.find_file_in_collection( _source_file, collection, :ignore )
153
+ generated = [_source_file, collection]
150
154
 
151
155
  # Generated partials -- same per-test scoping rationale as mocks, above
152
- elsif (!release) and
156
+ elsif !partials_root.nil? and
153
157
  (source_file.start_with?( PARTIAL_FILENAME_PREFIX ))
154
158
  # A generated Partial sits in the subdirectory mirroring its own module, so that
155
159
  # subdirectory is what distinguishes two modules sharing a basename. Derived the
156
160
  # same way a mock's is, above.
157
- partials_root = File.join(@configurator.project_test_partials_path, test_context)
158
- subdir = generated_file_subdir( filepath, partials_root, test: test, context: context )
161
+ subdir = generated_file_subdir( filepath, partials_root, test: test_context, context: context )
159
162
 
160
163
  _source_file = source_file + EXTENSION_CORE_SOURCE
161
164
  _source_file = File.join( subdir, _source_file ) unless subdir.empty?
162
165
 
163
- collection = own_generated_files( @configurator.project_test_partials_path, test_context )
166
+ collection = own_generated_files( partials_root )
164
167
 
165
168
  # Ambiguity is detected here rather than rescued from the matching below. One
166
169
  # matching implementation stays in force, and the message is composed from the
167
170
  # module names the test author wrote instead of reworded by exception.
168
171
  raise_ambiguous_partial!( _source_file, collection, partials_root )
169
172
 
170
- found_file =
171
- @file_finder_helper.find_file_in_collection( _source_file, collection, complain )
173
+ found_file = @file_finder_helper.find_file_in_collection( _source_file, collection, :ignore )
174
+ generated = [_source_file, collection]
172
175
 
173
176
  # Vendor framework sources (unity.c, cmock.c, cexception.c, etc.)
174
177
  # Note: Taking a small chance by mixing test and release frameworks without smart checks on test/release build
@@ -193,8 +196,9 @@ class FileFinder
193
196
  end
194
197
 
195
198
  #
196
- # Above we can confidently rely on the complain parameter passed to file_finder_helper because
197
- # we know the specific type of file being searched for.
199
+ # Above, runners and vendor sources rely on the complain parameter passed to file_finder_helper,
200
+ # since the kind of file sought is certain. Mocks and Partials complain only once the lookup
201
+ # below misses too.
198
202
  #
199
203
  # Below we ignore file misses because of lgoical complexities of searching for potentially either
200
204
  # assmebly or C files, including C files that may not exist (counterparts to header files by convention).
@@ -209,6 +213,9 @@ class FileFinder
209
213
  found_file = find_compiled_input( query_file, release: release, exact: exact )
210
214
 
211
215
  if found_file.nil?
216
+ # A generated file's search complains as it would alone, naming the file it sought
217
+ return @file_finder_helper.find_file_in_collection( *generated, complain ) unless generated.nil?
218
+
212
219
  # Every name actually attempted, in the order tried, so a missing-file complaint
213
220
  # names every filename ceedling went looking for.
214
221
  tried = @configurator.extension_source.map { |ext| query_file + ext }
@@ -220,8 +227,8 @@ class FileFinder
220
227
  end
221
228
 
222
229
 
223
- # `collection`, when given, overrides collection_all_headers with a caller's own
224
- # already-ordered, per-test header list -- see find_header_input_for_mock's comment.
230
+ # `collection`, when given, overrides collection_all_headers with a test's HeaderSearch or
231
+ # a caller's own ordered header list -- see find_header_input_for_mock's comment.
225
232
  def find_header_file(filepath, complain = :error, collection: nil)
226
233
  return find_first_candidate(filepath, @configurator.extension_header, collection || @configurator.collection_all_headers, complain)
227
234
  end
@@ -295,30 +302,16 @@ class FileFinder
295
302
  raise CeedlingException.new( message )
296
303
  end
297
304
 
298
- # A test object's build directory is its test's name, the test's path from the project
299
- # root (e.g. `test/unit/test_foo` for `test/unit/test_foo.c`). Recovering that name from
300
- # a build artifact's own path lets a lookup go straight to the one test it belongs to,
301
- # rather than searching the whole project by bare basename -- exactly the query shape
302
- # that's ambiguous when another same-named test exists elsewhere.
303
- #
304
- # A filepath that isn't under the test build root at all (a source-tree-relative query
305
- # from an #include or TEST_SOURCE_FILE(), rather than a build artifact's own path) has no
306
- # test identity to recover -- empty string, never a directory name that could coincidentally
307
- # match some unrelated file's own basename.
305
+ # The name of the test whose own build directory holds `filepath` (TestBuildLayout#locate),
306
+ # such as `test/unit/test_foo` for an object below `build/test/out/test/unit/test_foo/_t_/`.
307
+ # It lets a lookup go straight to the one test a build file belongs to, rather than
308
+ # searching the whole project by bare basename, the query shape that's ambiguous when
309
+ # another same-named test exists elsewhere.
308
310
  #
309
- # A test's build directory also holds its objects at their sources' own paths, so the
310
- # name is the longest one of a known test that the directory begins with.
311
- def test_context_of(filepath)
312
- subdir = ProjectPaths.subdir_below( @configurator.project_test_build_output_path, File.dirname( filepath ) )
313
- return '' if subdir.nil?
314
-
315
- parts = subdir.split( '/' )
316
- parts.length.downto( 1 ) do |count|
317
- name = parts.first( count ).join( '/' )
318
- return name if test_files_by_name.key?( name )
319
- end
320
-
321
- return ''
311
+ # A filepath below no test's own directory, such as a source-tree-relative query from an
312
+ # #include or TEST_SOURCE_FILE(), has no test to recover and gives ''.
313
+ def test_context_of(filepath, context)
314
+ return @test_build_layout.locate( filepath, context: context ) || ''
322
315
  end
323
316
 
324
317
  # A test's runner lives where FilePathUtils#form_test_runners_path puts it. Takes the test
@@ -336,40 +329,10 @@ class FileFinder
336
329
  end
337
330
  end
338
331
 
339
- # For each test's name, the names of the tests nested beneath it (`test/test_foo/test_bar`
340
- # beneath `test/test_foo`)
341
- def nested_test_names
342
- names = test_files_by_name.keys
343
- @test_names_lock.synchronize do
344
- @nested_test_names ||= nest_names( names )
345
- end
346
- end
347
-
348
- # Files each name under every other name that is one of its parent directories
349
- def nest_names(names)
350
- known = names.to_set
351
- nested = Hash.new { |hash, name| hash[name] = [] }
352
-
353
- names.each do |name|
354
- parts = name.split( '/' )
355
- (1...parts.length).each do |count|
356
- parent = parts.first( count ).join( '/' )
357
- nested[parent] << name if known.include?( parent )
358
- end
359
- end
360
-
361
- return nested
362
- end
363
-
364
- # A test's generated mocks or Partials, beneath its own directory below `base`. A test
365
- # whose name continues this one's (`test/test_foo/test_bar` after `test/test_foo`) has its
366
- # directory nested here, and the files in it are that test's own.
367
- def own_generated_files(base, test_context)
368
- listing = @file_wrapper.directory_listing( FilePathUtils.glob( File.join( base, test_context ), '**/*' + EXTENSION_CORE_SOURCE ) )
369
- nested = nested_test_names.fetch( test_context, [] ).map { |name| File.join( base, name ) + '/' }
370
- return listing if nested.empty?
371
-
372
- return listing.reject { |file| nested.any? { |dir| file.start_with?( dir ) } }
332
+ # A test's generated mocks or Partials, below its own root of that kind. No other test's
333
+ # root lies below it, so every file there is this test's own.
334
+ def own_generated_files(root)
335
+ return @file_wrapper.directory_listing( FilePathUtils.glob( root, '**/*' + EXTENSION_CORE_SOURCE ) )
373
336
  end
374
337
 
375
338
  # The query for the source of a release or module-under-test object, and whether it is
@@ -392,7 +355,11 @@ class FileFinder
392
355
  basename = File.basename( filepath ).ext('')
393
356
  return [basename, false] if subdir.nil? || subdir.empty?
394
357
 
395
- return [File.join( BuildSubpath.decode( subdir ), basename ), true]
358
+ # A marker no shortened root holds was placed by another configuration
359
+ source_dir = BuildSubpath.decode( subdir, roots: @file_path_utils.build_roots, release: release )
360
+ return [basename, false] if source_dir.nil?
361
+
362
+ return [File.join( source_dir, basename ), true]
396
363
  end
397
364
 
398
365
  def source_tree_query(filepath)
@@ -403,9 +370,8 @@ class FileFinder
403
370
  # The root a release or test object is placed below, or nil where none is known
404
371
  def placement_root(release, test, context)
405
372
  return @configurator.project_release_build_output_path if release
406
- return nil if test.nil?
407
373
 
408
- return @file_path_utils.form_test_build_path( test, context: context )
374
+ return @test_build_layout.root( :out, test, context: context )
409
375
  end
410
376
 
411
377
  # The file of `collection` at exactly `query` plus one of `extension`'s spellings, or nil.
@@ -436,7 +402,7 @@ class FileFinder
436
402
  # fallback preprocessing builds a generated #include from a module name instead of
437
403
  # resolving the file. Whatever directory such a name carries is the module's own.
438
404
  def generated_file_subdir(filepath, root, test:, context:)
439
- out_root = test.nil? ? nil : @file_path_utils.form_test_build_path(test, context: context)
405
+ out_root = @test_build_layout.root( :out, test, context: context )
440
406
 
441
407
  subdir = PathMirror.relative_subdir( filepath, [root, out_root].compact )
442
408
 
@@ -543,7 +509,7 @@ class FileFinder
543
509
  if strict
544
510
  return PathMatcher.match(candidate, collection)
545
511
  else
546
- winner, _others = PathMatcher.resolve(candidate, collection)
512
+ winner, _others = @file_finder_helper.resolve_in_collection(candidate, collection)
547
513
  return winner
548
514
  end
549
515
  end
@@ -26,13 +26,12 @@ class FileFinderHelper
26
26
  return not_found_in_collection(filename, file_list, complain)
27
27
  end
28
28
 
29
- # As `#find_file_in_collection`, but never raises on ambiguity -- a query matching
30
- # more than one file resolves to the first entry in `file_list`'s own order (which
31
- # already reflects real project path priority), with an ℹ️ NOTICE naming what else
32
- # matched so the choice isn't silent. Every test that names the file makes the same
33
- # choice, so a build notes it once.
29
+ # As `#find_file_in_collection`, but never raises on ambiguity. A query matching more
30
+ # than one file resolves to the first in `file_list`'s order, or to a HeaderSearch's
31
+ # first in search order, with an ℹ️ NOTICE naming what else matched so the choice isn't
32
+ # silent. Every test that names the file makes the same choice, so a build notes it once.
34
33
  def resolve_file_in_collection(filename, file_list, complain)
35
- found, others = PathMatcher.resolve(filename, file_list)
34
+ found, others = resolve_in_collection(filename, file_list)
36
35
  return not_found_in_collection(filename, file_list, complain) if found.nil?
37
36
 
38
37
  unless others.empty?
@@ -46,6 +45,15 @@ class FileFinderHelper
46
45
  return found
47
46
  end
48
47
 
48
+ # The winner and the other candidates for `filename`, from a file list or a
49
+ # HeaderSearch, which finds a header as the compiler does
50
+ def resolve_in_collection(filename, collection)
51
+ return PathMatcher.resolve(filename, collection) unless collection.respond_to?( :header_candidates )
52
+
53
+ found = collection.header_candidates( filename )
54
+ return [found.first, found.drop( 1 )]
55
+ end
56
+
49
57
  def find_best_path_in_collection(pathname, path_list, complain, description)
50
58
  # search our collection for the specified exact path
51
59
  raise "No path list provided for #{description} search" if path_list.nil?
@@ -61,11 +69,11 @@ class FileFinderHelper
61
69
  return path_list[best_index( scores )]
62
70
  end
63
71
 
64
- def handle_missing_file(filename, complain)
72
+ def handle_missing_file(filename, complain, extra_message = '')
65
73
  case (complain)
66
- when :error then blow_up(filename)
74
+ when :error then blow_up(filename, extra_message)
67
75
  when :warn
68
- gripe(filename)
76
+ gripe(filename, extra_message)
69
77
  return nil
70
78
  when :ignore then return nil
71
79
  end
@@ -81,15 +89,23 @@ class FileFinderHelper
81
89
  # can find any candidate at all, so the query's own basename gets one last check
82
90
  # against every list entry case-insensitively -- catches the common slip of a
83
91
  # filename typed with the wrong case before falling through to the caller's own
84
- # not-found handling.
92
+ # not-found handling. An entry ending in the very same text is no such slip. It lies
93
+ # where the search doesn't reach, as a HeaderSearch's hint files may.
85
94
  #
86
95
  # `complain` of :silent skips that check. A caller asks for silence when it can't know
87
96
  # whether the reference is even live, such as a scan of #includes that ignores #if, and
88
97
  # a later, authoritative lookup reports a real slip.
98
+ #
99
+ # A HeaderSearch's refusal comes first. It explains why the header lies beyond every
100
+ # search path, which a case check can't.
89
101
  def not_found_in_collection(filename, file_list, complain)
90
102
  return nil if complain == :silent
91
103
 
92
- matches = file_list.find_all {|v| v =~ /(?:\\|\/|^)#{Regexp.escape(filename)}$/i}
104
+ refusal = file_list.respond_to?( :refusal ) ? file_list.refusal( filename ) : nil
105
+ return handle_missing_file( filename, complain, refusal ) unless refusal.nil?
106
+
107
+ files = file_list.respond_to?( :hint_files ) ? file_list.hint_files( filename ) : file_list
108
+ matches = letter_case_slips( filename, files )
93
109
  if (matches.length > 0)
94
110
  blow_up(filename, "However, a filename having different capitalization was found: '#{matches[0]}'.")
95
111
  end
@@ -97,6 +113,12 @@ class FileFinderHelper
97
113
  return handle_missing_file(filename, complain)
98
114
  end
99
115
 
116
+ # The files ending in `filename` spelled in another letter case
117
+ def letter_case_slips(filename, files)
118
+ pattern = /(?:\\|\/|^)(#{Regexp.escape(filename)})$/i
119
+ return files.find_all { |file| (tail = file[pattern, 1]) && tail != filename }
120
+ end
121
+
100
122
  def blow_up(filename, extra_message="")
101
123
  error = ["Found no file `#{filename}` in search paths.", extra_message].join(' ').strip
102
124
  raise CeedlingException.new( error )