ceedling 1.2.0 → 1.2.2

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 (383) hide show
  1. checksums.yaml +4 -4
  2. data/GIT_COMMIT_SHA +1 -1
  3. data/README.md +57 -58
  4. data/Rakefile +5 -3
  5. data/assets/features/ceedling +1 -1
  6. data/assets/fixtures/test_source_file_duplicate_basenames/test_calc_typo.c +14 -0
  7. data/assets/fixtures/tests_with_duplicate_test_names/test_foo.c +21 -0
  8. data/bin/actionator.rb +6 -12
  9. data/bin/app_cfg.rb +35 -1
  10. data/bin/ceedling +13 -3
  11. data/bin/cli.rb +25 -6
  12. data/bin/cli_handler.rb +119 -73
  13. data/bin/cli_helper.rb +56 -78
  14. data/bin/installation_selector.rb +81 -0
  15. data/bin/launchinator.rb +69 -0
  16. data/bin/mixin_resolvinator.rb +26 -36
  17. data/bin/objects.yml +13 -0
  18. data/bin/path_validator.rb +25 -29
  19. data/bin/versionator.rb +47 -48
  20. data/ceedling.gemspec +19 -15
  21. data/docs/BreakingChanges.md +70 -1
  22. data/docs/Changelog.md +84 -3
  23. data/docs/KnownIssues.md +90 -4
  24. data/docs/ReleaseNotes.md +13 -0
  25. data/docs/overrides/main.html +11 -8
  26. data/lib/ceedling/build_log_writer.rb +33 -0
  27. data/lib/ceedling/config/build_root_policy.rb +70 -0
  28. data/lib/ceedling/config/configurator.rb +19 -18
  29. data/lib/ceedling/config/configurator_builder.rb +58 -28
  30. data/lib/ceedling/config/configurator_paths_validator.rb +179 -0
  31. data/lib/ceedling/config/configurator_plugins.rb +1 -1
  32. data/lib/ceedling/config/configurator_setup.rb +39 -41
  33. data/lib/ceedling/config/configurator_validator.rb +1 -110
  34. data/lib/ceedling/defaults.rb +4 -4
  35. data/lib/ceedling/dependencies/README.md +18 -16
  36. data/lib/ceedling/dependencies/dependency_cache_store.rb +20 -3
  37. data/lib/ceedling/dependencies/dependency_hasher.rb +35 -1
  38. data/lib/ceedling/filename_extension.rb +7 -1
  39. data/lib/ceedling/filesystem/FILE_TREE.md +253 -0
  40. data/lib/ceedling/filesystem/PATH_HANDLING.md +304 -0
  41. data/lib/ceedling/filesystem/README.md +41 -0
  42. data/lib/ceedling/filesystem/build_subpath.rb +102 -0
  43. data/lib/ceedling/filesystem/destination_collision.rb +25 -0
  44. data/lib/ceedling/{file_finder.rb → filesystem/file_finder.rb} +159 -104
  45. data/lib/ceedling/{file_finder_helper.rb → filesystem/file_finder_helper.rb} +36 -31
  46. data/lib/ceedling/filesystem/file_path_collection_utils.rb +183 -0
  47. data/lib/ceedling/{file_path_utils.rb → filesystem/file_path_utils.rb} +108 -97
  48. data/lib/ceedling/{file_system_wrapper.rb → filesystem/file_system_wrapper.rb} +6 -5
  49. data/lib/ceedling/filesystem/file_tree.rb +241 -0
  50. data/lib/ceedling/{file_wrapper.rb → filesystem/file_wrapper.rb} +65 -28
  51. data/lib/ceedling/filesystem/path_exclusions.rb +30 -0
  52. data/lib/ceedling/{path_matcher.rb → filesystem/path_matcher.rb} +27 -23
  53. data/lib/ceedling/{path_mirror.rb → filesystem/path_mirror.rb} +19 -18
  54. data/lib/ceedling/filesystem/path_spellings.rb +55 -0
  55. data/lib/ceedling/filesystem/project_paths.rb +184 -0
  56. data/lib/ceedling/filesystem/working_dir.rb +40 -0
  57. data/lib/ceedling/generators/generator.rb +5 -6
  58. data/lib/ceedling/generators/generator_partials.rb +1 -1
  59. data/lib/ceedling/generators/generator_test_results_backtrace.rb +7 -7
  60. data/lib/ceedling/handoff.rb +121 -0
  61. data/lib/ceedling/includes/include_factory.rb +3 -3
  62. data/lib/ceedling/includes/include_pathinator.rb +67 -10
  63. data/lib/ceedling/includes/includes.rb +1 -1
  64. data/lib/ceedling/installation.rb +92 -0
  65. data/lib/ceedling/library_resolver.rb +99 -0
  66. data/lib/ceedling/objects.yml +23 -2
  67. data/lib/ceedling/partials/partializer.rb +4 -4
  68. data/lib/ceedling/partials/partializer_config.rb +3 -1
  69. data/lib/ceedling/plugins/report_log_writer_plugin.rb +3 -5
  70. data/lib/ceedling/preprocess/preprocessinator_file_assembler.rb +1 -1
  71. data/lib/ceedling/preprocess/preprocessinator_includes_handler.rb +1 -1
  72. data/lib/ceedling/preprocess/preprocessinator_line_marker_includes_extractor.rb +1 -1
  73. data/lib/ceedling/rake_app/rakefile_component_resolver.rb +10 -17
  74. data/lib/ceedling/rake_app/test_task_name.rb +29 -0
  75. data/lib/ceedling/rakefile.rb +16 -1
  76. data/lib/ceedling/rakefiles/base/tasks_base.rake +1 -1
  77. data/lib/ceedling/rakefiles/release/rules_release.rake +4 -7
  78. data/lib/ceedling/rakefiles/tests/rules_tests.rake +3 -20
  79. data/lib/ceedling/rakefiles/tests/rules_tests_generate.rake +4 -30
  80. data/lib/ceedling/release_invoker/release_build_executor.rb +33 -44
  81. data/lib/ceedling/release_invoker/release_build_planner.rb +14 -6
  82. data/lib/ceedling/reportinator.rb +3 -4
  83. data/lib/ceedling/setupinator.rb +95 -87
  84. data/lib/ceedling/test_context_extractor.rb +5 -1
  85. data/lib/ceedling/test_invoker/PIPELINE.md +9 -7
  86. data/lib/ceedling/test_invoker/mock_locator.rb +60 -2
  87. data/lib/ceedling/test_invoker/partials_manager.rb +12 -0
  88. data/lib/ceedling/test_invoker/standin_headerinator.rb +22 -13
  89. data/lib/ceedling/test_invoker/test_build_executor.rb +42 -41
  90. data/lib/ceedling/test_invoker/test_build_planner.rb +37 -18
  91. data/lib/ceedling/test_invoker/test_build_setup.rb +17 -12
  92. data/lib/ceedling/test_invoker/test_build_validations.rb +16 -31
  93. data/lib/ceedling/test_invoker/test_file_preprocessinator.rb +1 -1
  94. data/lib/ceedling/test_invoker/test_invoker.rb +6 -1
  95. data/lib/ceedling/test_invoker/test_pipeline_helpers.rb +1 -1
  96. data/lib/ceedling/test_invoker/test_source_file_directive_resolver.rb +40 -20
  97. data/lib/ceedling/tool_executor.rb +9 -3
  98. data/lib/ceedling/yaml_wrapper.rb +3 -2
  99. data/lib/version.rb +1 -1
  100. data/plugins/bullseye/bullseye.rake +6 -9
  101. data/plugins/bullseye/config/defaults_bullseye.rb +1 -1
  102. data/plugins/bullseye/lib/bullseye.rb +9 -7
  103. data/plugins/cppcheck/config/defaults_cppcheck.rb +1 -1
  104. data/plugins/dependencies/config/defaults.yml +6 -6
  105. data/plugins/dependencies/dependencies.rake +4 -1
  106. data/plugins/dependencies/lib/dependencies.rb +18 -8
  107. data/plugins/dependencies/lib/dependency_spec.rb +17 -5
  108. data/plugins/fff/lib/fff.rb +45 -39
  109. data/plugins/fff/spec/fff_cmock_wrapper_spec.rb +128 -0
  110. data/plugins/gcov/config/defaults_gcov.rb +1 -1
  111. data/plugins/gcov/gcov.rake +6 -9
  112. data/plugins/gcov/lib/console_reportinator.rb +4 -18
  113. data/plugins/gcov/lib/gcov.rb +9 -2
  114. data/plugins/gcov/lib/gcovr_reportinator.rb +8 -40
  115. data/plugins/gcov/lib/gcovr_thresholds.rb +74 -0
  116. data/plugins/gcov/lib/reportgenerator_reportinator.rb +1 -1
  117. data/plugins/module_generator/lib/module_generator.rb +3 -3
  118. data/plugins/report_tests_teamcity_stdout/lib/report_tests_teamcity_stdout.rb +53 -80
  119. data/plugins/sanitize/lib/sanitize_records.rb +3 -6
  120. data/plugins/sanitize/sanitize.rake +6 -6
  121. data/plugins/valgrind/lib/valgrind.rb +14 -7
  122. data/plugins/valgrind/valgrind.rake +6 -6
  123. data/site-local/404.html +6 -20
  124. data/site-local/assets/javascripts/{bundle.d7400e89.min.js → bundle.c21346df.min.js} +3 -3
  125. data/site-local/assets/javascripts/{bundle.d7400e89.min.js.map → bundle.c21346df.min.js.map} +2 -2
  126. data/site-local/assets/javascripts/workers/{search.2c215733.min.js → search.a7633da7.min.js} +2 -2
  127. data/site-local/assets/javascripts/workers/{search.2c215733.min.js.map → search.a7633da7.min.js.map} +1 -1
  128. data/site-local/assets/stylesheets/main.57a0d79d.min.css +6 -0
  129. data/site-local/assets/stylesheets/main.57a0d79d.min.css.map +1 -0
  130. data/site-local/assets/stylesheets/palette.fb2fffe2.min.css +4 -0
  131. data/site-local/assets/stylesheets/palette.fb2fffe2.min.css.map +1 -0
  132. data/site-local/configuration/environment-vars.html +6 -20
  133. data/site-local/configuration/global-collections.html +6 -20
  134. data/site-local/configuration/index.html +6 -20
  135. data/site-local/configuration/loading.html +6 -20
  136. data/site-local/configuration/mixins.html +10 -24
  137. data/site-local/configuration/parallel-builds.html +6 -20
  138. data/site-local/configuration/project-file.html +8 -22
  139. data/site-local/configuration/reference/cexception.html +6 -20
  140. data/site-local/configuration/reference/cmock.html +8 -21
  141. data/site-local/configuration/reference/defines.html +16 -30
  142. data/site-local/configuration/reference/environment.html +10 -24
  143. data/site-local/configuration/reference/extension.html +6 -20
  144. data/site-local/configuration/reference/files.html +22 -30
  145. data/site-local/configuration/reference/flags.html +13 -27
  146. data/site-local/configuration/reference/index.html +6 -20
  147. data/site-local/configuration/reference/libraries.html +27 -23
  148. data/site-local/configuration/reference/mixins.html +6 -20
  149. data/site-local/configuration/reference/partials.html +6 -20
  150. data/site-local/configuration/reference/paths.html +38 -29
  151. data/site-local/configuration/reference/plugins.html +6 -20
  152. data/site-local/configuration/reference/project.html +32 -36
  153. data/site-local/configuration/reference/release-build.html +8 -20
  154. data/site-local/configuration/reference/test-build.html +6 -20
  155. data/site-local/configuration/reference/test-runner.html +6 -20
  156. data/site-local/configuration/reference/tools.html +27 -32
  157. data/site-local/configuration/reference/unity.html +6 -20
  158. data/site-local/configuration/which-ceedling.html +383 -37
  159. data/site-local/development/index.html +6 -20
  160. data/site-local/development/plugins/configuration.html +6 -20
  161. data/site-local/development/plugins/index.html +6 -20
  162. data/site-local/development/plugins/plugin-subclass.html +54 -68
  163. data/site-local/development/plugins/rake-tasks.html +8 -22
  164. data/site-local/development/releases.html +84 -29
  165. data/site-local/development/workflow.html +62 -71
  166. data/site-local/getting-started/builds.html +8 -20
  167. data/site-local/getting-started/command-line.html +62 -24
  168. data/site-local/getting-started/example-projects/cipher-quest.html +6 -20
  169. data/site-local/getting-started/example-projects/index.html +6 -20
  170. data/site-local/getting-started/example-projects/temp-sensor.html +6 -20
  171. data/site-local/getting-started/example-projects/wondrous-forest.html +6 -20
  172. data/site-local/getting-started/index.html +6 -20
  173. data/site-local/getting-started/installation.html +6 -20
  174. data/site-local/getting-started/quick-start.html +6 -20
  175. data/site-local/help.html +6 -20
  176. data/site-local/index.html +11 -24
  177. data/site-local/overview/build-system.html +6 -20
  178. data/site-local/overview/index.html +6 -20
  179. data/site-local/overview/test-environments.html +6 -20
  180. data/site-local/overview/tools-and-frameworks.html +6 -20
  181. data/site-local/plugins/beep.html +6 -20
  182. data/site-local/plugins/bullseye/index.html +13 -24
  183. data/site-local/plugins/bullseye/licensing.html +14 -28
  184. data/site-local/plugins/command-hooks.html +8 -22
  185. data/site-local/plugins/compile-commands-json-db.html +6 -20
  186. data/site-local/plugins/cppcheck.html +8 -22
  187. data/site-local/plugins/dependencies.html +16 -27
  188. data/site-local/plugins/fff.html +49 -32
  189. data/site-local/plugins/gcov/examples.html +7 -21
  190. data/site-local/plugins/gcov/gcovr.html +22 -33
  191. data/site-local/plugins/gcov/index.html +6 -20
  192. data/site-local/plugins/gcov/overview.html +9 -20
  193. data/site-local/plugins/gcov/reportgenerator.html +9 -23
  194. data/site-local/plugins/gcov/reporting.html +6 -20
  195. data/site-local/plugins/gcov/setup.html +8 -21
  196. data/site-local/plugins/gcov/tool-versions.html +6 -20
  197. data/site-local/plugins/gcov/troubleshooting.html +10 -24
  198. data/site-local/plugins/index.html +6 -20
  199. data/site-local/plugins/module-generator.html +21 -35
  200. data/site-local/plugins/report-build-warnings-log.html +53 -67
  201. data/site-local/plugins/report-tests-gtestlike-stdout.html +6 -20
  202. data/site-local/plugins/report-tests-ide-stdout.html +43 -57
  203. data/site-local/plugins/report-tests-log-factory.html +50 -64
  204. data/site-local/plugins/report-tests-pretty-stdout.html +7 -21
  205. data/site-local/plugins/report-tests-raw-output-log.html +9 -21
  206. data/site-local/plugins/report-tests-teamcity-stdout.html +20 -31
  207. data/site-local/plugins/sanitize.html +56 -65
  208. data/site-local/plugins/valgrind.html +49 -58
  209. data/site-local/project/index.html +6 -20
  210. data/site-local/project/release-history.html +6 -20
  211. data/site-local/project/sbom.html +6 -20
  212. data/site-local/project/upgrade.html +9 -20
  213. data/site-local/reference/build-directives.html +6 -20
  214. data/site-local/reference/command-line.html +15 -22
  215. data/site-local/reference/environment-vars.html +6 -20
  216. data/site-local/reference/gcov-plugin.html +6 -20
  217. data/site-local/reference/global-collections.html +6 -20
  218. data/site-local/reference/index.html +6 -20
  219. data/site-local/reference/partials-macros.html +6 -20
  220. data/site-local/reference/project-configuration.html +6 -20
  221. data/site-local/sitemap.xml.gz +0 -0
  222. data/site-local/snapshot/examples/cipher_quest/index.html +16 -30
  223. data/site-local/snapshot/examples/temp_sensor/index.html +8 -22
  224. data/site-local/snapshot/examples/wondrous_forest/index.html +6 -20
  225. data/site-local/snapshot/plugins/bullseye/config/defaults_bullseye.rb +1 -1
  226. data/site-local/snapshot/plugins/gcov/config/defaults_gcov.rb +1 -1
  227. data/site-local/testing-guide/build-directives.html +14 -28
  228. data/site-local/testing-guide/conventions.html +66 -27
  229. data/site-local/testing-guide/frameworks.html +11 -25
  230. data/site-local/testing-guide/index.html +6 -20
  231. data/site-local/testing-guide/partials/configuration.html +8 -22
  232. data/site-local/testing-guide/partials/conventions.html +8 -22
  233. data/site-local/testing-guide/partials/directives.html +16 -30
  234. data/site-local/testing-guide/partials/example.html +14 -28
  235. data/site-local/testing-guide/partials/index.html +6 -20
  236. data/site-local/testing-guide/partials/overview.html +6 -20
  237. data/site-local/testing-guide/partials/variables.html +11 -25
  238. data/site-local/testing-guide/test-cases.html +13 -27
  239. data/site-local/testing-guide/test-sample.html +12 -26
  240. data/site-local/testing-guide/test-suite-anatomy.html +6 -20
  241. data/spec/integration/actionator_file_operations_spec.rb +91 -1
  242. data/spec/integration/compile_commands_json_db_spec.rb +1 -1
  243. data/spec/integration/configurator_pipeline_spec.rb +10 -0
  244. data/spec/integration/configurator_validation_spec.rb +1 -1
  245. data/spec/integration/dependencies/dependency_tracker_cache_hardening_spec.rb +26 -0
  246. data/spec/integration/dependencies/dependency_tracker_core_spec.rb +62 -0
  247. data/spec/integration/launcher_handoff_spec.rb +297 -0
  248. data/spec/integration/mixin_loading_spec.rb +1 -1
  249. data/spec/integration/module_generator_spec.rb +3 -3
  250. data/spec/integration/nested_test_artifacts_spec.rb +99 -0
  251. data/spec/integration/partials_module_resolution_spec.rb +7 -4
  252. data/spec/integration/path_intake_scenarios_spec.rb +101 -0
  253. data/spec/integration/path_scenarios_spec.rb +322 -0
  254. data/spec/integration/quote_include_isolator_spec.rb +1 -1
  255. data/spec/integration/rake_task_registry_plugins_spec.rb +95 -0
  256. data/spec/integration/report_build_warnings_log_spec.rb +1 -1
  257. data/spec/integration/report_tests_log_factory_spec.rb +1 -1
  258. data/spec/integration/test_executable_manifest_spec.rb +1 -1
  259. data/spec/integration/test_includes_extractinator_spec.rb +2 -1
  260. data/spec/integration/test_naming_spec.rb +198 -0
  261. data/spec/integration/test_source_file_checks_spec.rb +166 -0
  262. data/spec/integration/tool_validator_spec.rb +1 -1
  263. data/spec/integration/upgrade_docs_spec.rb +84 -0
  264. data/spec/integration/vendor_copy_transient_io_retry_spec.rb +192 -75
  265. data/spec/support/file_tree_helper.rb +88 -0
  266. data/spec/support/integration/configurator_integration_helper.rb +10 -7
  267. data/spec/support/integration/dependency_tracker_integration_helper.rb +1 -1
  268. data/spec/support/integration/partials_generation_integration_helper.rb +2 -2
  269. data/spec/support/integration/path_scenario_harness.rb +173 -0
  270. data/spec/support/integration/spec_integration_helper.rb +1 -1
  271. data/spec/support/integration/test_includes_harness.rb +13 -2
  272. data/spec/support/spec_helper.rb +2 -0
  273. data/spec/support/system/spec_system_helper.rb +7 -6
  274. data/spec/support/system/system_context.rb +21 -3
  275. data/spec/support/working_dir_tracking.rb +49 -0
  276. data/spec/system/build_output_mirroring_spec.rb +2 -2
  277. data/spec/system/conditional_mock_includes_spec.rb +1 -1
  278. data/spec/system/delta_builds_spec.rb +137 -11
  279. data/spec/system/gcov_deployment_spec.rb +1 -0
  280. data/spec/system/header_include_path_validation_spec.rb +4 -4
  281. data/spec/system/launcher_handoff_spec.rb +82 -0
  282. data/spec/system/mock_include_folders_spec.rb +91 -0
  283. data/spec/system/parent_directory_reference_spec.rb +5 -3
  284. data/spec/system/path_handling_probes_spec.rb +192 -0
  285. data/spec/system/preprocessing_parameterized_tests_spec.rb +1 -1
  286. data/spec/system/rake_release_task_path_disambiguation_spec.rb +6 -6
  287. data/spec/system/rake_test_task_path_disambiguation_spec.rb +85 -0
  288. data/spec/system/special_path_characters_spec.rb +86 -0
  289. data/spec/system/support/common_test_cases.rb +23 -21
  290. data/spec/system/support/gcov_common_test_cases.rb +37 -9
  291. data/spec/system/support/sanitize_common_test_cases.rb +2 -2
  292. data/spec/system/support/valgrind_common_test_cases.rb +12 -12
  293. data/spec/system/test_pipeline_stop_points_spec.rb +4 -4
  294. data/spec/system/test_runner_system_include_spec.rb +1 -1
  295. data/spec/system/test_source_file_directive_spec.rb +34 -5
  296. data/spec/units/bin/actionator_spec.rb +14 -17
  297. data/spec/units/bin/app_cfg_spec.rb +47 -0
  298. data/spec/units/bin/cli_handler_spec.rb +284 -7
  299. data/spec/units/bin/cli_helper_spec.rb +126 -45
  300. data/spec/units/bin/installation_selector_spec.rb +114 -0
  301. data/spec/units/bin/launchinator_spec.rb +171 -0
  302. data/spec/units/bin/path_validator_spec.rb +10 -0
  303. data/spec/units/bin/versionator_spec.rb +38 -6
  304. data/spec/units/build_log_writer_spec.rb +57 -0
  305. data/spec/units/config/build_root_policy_spec.rb +61 -0
  306. data/spec/units/config/configurator_builder_spec.rb +37 -6
  307. data/spec/units/config/configurator_paths_validator_spec.rb +292 -0
  308. data/spec/units/config/configurator_setup_spec.rb +65 -103
  309. data/spec/units/config/configurator_spec.rb +37 -6
  310. data/spec/units/config/configurator_validator_spec.rb +1 -172
  311. data/spec/units/default_tools_quoting_spec.rb +83 -0
  312. data/spec/units/dependencies/dependency_cache_store_spec.rb +33 -2
  313. data/spec/units/dependencies/dependency_debug_tree_spec.rb +1 -1
  314. data/spec/units/dependencies/dependency_hasher_spec.rb +42 -1
  315. data/spec/units/dependencies/dependency_path_normalizer_spec.rb +1 -1
  316. data/spec/units/dependencies/dependency_tracker_spec.rb +3 -1
  317. data/spec/units/filename_extension_spec.rb +11 -0
  318. data/spec/units/filesystem/build_subpath_spec.rb +122 -0
  319. data/spec/units/filesystem/destination_collision_spec.rb +30 -0
  320. data/spec/units/{file_finder_helper_spec.rb → filesystem/file_finder_helper_spec.rb} +46 -1
  321. data/spec/units/{file_finder_spec.rb → filesystem/file_finder_spec.rb} +188 -22
  322. data/spec/units/{file_path_collection_utils_spec.rb → filesystem/file_path_collection_utils_spec.rb} +181 -1
  323. data/spec/units/{file_path_utils_spec.rb → filesystem/file_path_utils_spec.rb} +204 -87
  324. data/spec/units/filesystem/file_system_wrapper_spec.rb +33 -0
  325. data/spec/units/filesystem/file_tree_spec.rb +511 -0
  326. data/spec/units/filesystem/file_tree_windows_spec.rb +78 -0
  327. data/spec/units/{file_wrapper_spec.rb → filesystem/file_wrapper_spec.rb} +154 -32
  328. data/spec/units/{path_matcher_spec.rb → filesystem/path_matcher_spec.rb} +12 -1
  329. data/spec/units/{path_mirror_spec.rb → filesystem/path_mirror_spec.rb} +32 -4
  330. data/spec/units/filesystem/project_paths_spec.rb +147 -0
  331. data/spec/units/filesystem/working_dir_spec.rb +71 -0
  332. data/spec/units/generators/generator_spec.rb +12 -6
  333. data/spec/units/generators/generator_test_results_backtrace_spec.rb +50 -46
  334. data/spec/units/generators/generator_test_results_spec.rb +1 -1
  335. data/spec/units/handoff_spec.rb +205 -0
  336. data/spec/units/includes/include_factory_spec.rb +3 -3
  337. data/spec/units/includes/include_pathinator_spec.rb +46 -0
  338. data/spec/units/installation_spec.rb +228 -0
  339. data/spec/units/library_resolver_spec.rb +157 -0
  340. data/spec/units/mock_locator_spec.rb +76 -1
  341. data/spec/units/partials/partializer_config_spec.rb +7 -0
  342. data/spec/units/partials/partializer_spec.rb +1 -0
  343. data/spec/units/partials_manager_spec.rb +17 -0
  344. data/spec/units/plugins/bullseye_spec.rb +15 -2
  345. data/spec/units/plugins/console_reportinator_spec.rb +18 -20
  346. data/spec/units/plugins/dependencies_spec.rb +33 -7
  347. data/spec/units/plugins/dependency_spec_spec.rb +17 -0
  348. data/spec/units/plugins/gcov_spec.rb +28 -3
  349. data/spec/units/plugins/gcovr_reportinator_spec.rb +19 -47
  350. data/spec/units/plugins/gcovr_thresholds_spec.rb +95 -0
  351. data/spec/units/plugins/module_generator_spec.rb +5 -5
  352. data/spec/units/plugins/report_build_warnings_log_spec.rb +3 -3
  353. data/spec/units/plugins/report_log_writer_plugin_spec.rb +10 -1
  354. data/spec/units/plugins/report_tests_raw_output_log_spec.rb +13 -2
  355. data/spec/units/plugins/report_tests_teamcity_stdout_spec.rb +77 -3
  356. data/spec/units/plugins/reportgenerator_reportinator_spec.rb +1 -1
  357. data/spec/units/plugins/sanitize_records_spec.rb +3 -1
  358. data/spec/units/plugins/sanitize_spec.rb +1 -1
  359. data/spec/units/plugins/valgrind_spec.rb +23 -8
  360. data/spec/units/preprocess/preprocessinator_comment_stripper_spec.rb +1 -1
  361. data/spec/units/rake_app/rakefile_component_resolver_spec.rb +21 -0
  362. data/spec/units/rake_app/test_task_name_spec.rb +47 -0
  363. data/spec/units/release_build_executor_spec.rb +53 -14
  364. data/spec/units/release_build_planner_spec.rb +15 -3
  365. data/spec/units/reportinator_spec.rb +5 -5
  366. data/spec/units/standin_headerinator_spec.rb +31 -1
  367. data/spec/units/test_build_executor_spec.rb +107 -5
  368. data/spec/units/test_build_planner_spec.rb +104 -2
  369. data/spec/units/test_build_setup_spec.rb +96 -12
  370. data/spec/units/test_context_extractor_spec.rb +25 -0
  371. data/spec/units/test_file_preprocessinator_spec.rb +17 -1
  372. data/spec/units/test_includes_extractinator_spec.rb +5 -1
  373. data/spec/units/test_invoker/objects_wiring_spec.rb +6 -3
  374. data/spec/units/test_invoker_spec.rb +14 -1
  375. data/spec/units/test_source_file_directive_resolver_spec.rb +38 -7
  376. data/spec/units/tool_executor_spec.rb +26 -0
  377. data/spec/units/yaml_wrapper_spec.rb +11 -0
  378. metadata +122 -33
  379. data/lib/ceedling/file_path_collection_utils.rb +0 -164
  380. data/site-local/assets/stylesheets/main.ec1eaa64.min.css +0 -1
  381. data/site-local/assets/stylesheets/main.ec1eaa64.min.css.map +0 -1
  382. data/site-local/assets/stylesheets/palette.ab4e12ef.min.css +0 -1
  383. data/site-local/assets/stylesheets/palette.ab4e12ef.min.css.map +0 -1
@@ -0,0 +1,92 @@
1
+ # =========================================================================
2
+ # Ceedling - Test-Centered Build System for C
3
+ # ThrowTheSwitch.org
4
+ # Copyright (c) 2010-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
5
+ # SPDX-License-Identifier: MIT
6
+ # =========================================================================
7
+
8
+ require 'rbconfig'
9
+
10
+ # One Ceedling installation, identified by its root directory. Its version is read
11
+ # from its own files, never from the constants of whichever installation loaded first.
12
+ #
13
+ # An application loaded by an older launcher reaches this file through require_relative
14
+ # with someone else's code already loaded, so it depends on nothing else in lib/.
15
+ class Installation
16
+
17
+ VERSION_FILE = File.join( 'lib', 'version.rb' )
18
+ BUILTIN_MIXINS_DIR = File.join( 'vendor', 'unity', 'test', 'targets' )
19
+
20
+ attr_reader :root
21
+
22
+ def self.windows?
23
+ return (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|msys|ucrt/i) ? true : false
24
+ end
25
+
26
+ def initialize(root)
27
+ @root = File.expand_path( root )
28
+ end
29
+
30
+ def bin_path
31
+ return File.join( @root, 'bin', 'ceedling' )
32
+ end
33
+
34
+ def rakefile_path
35
+ return File.join( @root, 'lib', 'ceedling', 'rakefile.rb' )
36
+ end
37
+
38
+ # The version tag, or nil when this installation's lib/version.rb is missing or unreadable
39
+ def version
40
+ @version = read_version() unless defined?( @version )
41
+ return @version
42
+ end
43
+
44
+ # True when this installation's launcher validates a built-in mixin directory the
45
+ # installation does not hold. `--local` vendoring left it out from 1.1.0 through 1.2.1,
46
+ # so such a copy fails on its own and only ever ran inside another launcher's process.
47
+ def missing_builtin_mixins?
48
+ mixins_filepath = File.join( @root, 'bin', 'mixins.rb' )
49
+ return false if !File.exist?( mixins_filepath )
50
+ return false if !File.read( mixins_filepath ).include?( 'BUILTIN_MIXIN_LOAD_PATHS' )
51
+
52
+ return !File.directory?( File.join( @root, BUILTIN_MIXINS_DIR ) )
53
+ end
54
+
55
+ # Symlinks resolve, and Windows paths compare without case
56
+ def ==(other)
57
+ return false unless other.is_a?( Installation )
58
+ return Installation.windows? ? identity.casecmp?( other.identity ) : (identity == other.identity)
59
+ end
60
+
61
+ # "Ceedling 1.2.0", or without the version when it cannot be read
62
+ def name(noun='Ceedling')
63
+ return [noun, version()].compact.join( ' ' )
64
+ end
65
+
66
+ # "Ceedling 1.2.0 at /path/", or without the version when it cannot be read
67
+ def describe(noun='Ceedling')
68
+ return "#{name( noun )} at #{@root}/"
69
+ end
70
+
71
+ protected
72
+
73
+ def identity
74
+ return File.realpath( @root )
75
+ rescue SystemCallError
76
+ return @root
77
+ end
78
+
79
+ private
80
+
81
+ # lib/version.rb defines Ceedling::Version. Evaluated within an anonymous module, its
82
+ # constants land beneath that module instead of reopening the loaded ::Ceedling.
83
+ def read_version
84
+ filepath = File.join( @root, VERSION_FILE )
85
+ sandbox = Module.new
86
+ sandbox.module_eval( File.read( filepath ), filepath )
87
+ return sandbox.const_get( :Ceedling, false ).const_get( :Version, false ).const_get( :TAG, false )
88
+ rescue StandardError, ScriptError
89
+ return nil
90
+ end
91
+
92
+ end
@@ -0,0 +1,99 @@
1
+ # =========================================================================
2
+ # Ceedling - Test-Centered Build System for C
3
+ # ThrowTheSwitch.org
4
+ # Copyright (c) 2010-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
5
+ # SPDX-License-Identifier: MIT
6
+ # =========================================================================
7
+
8
+ # Finds the library files a link's :libraries entries name, so a link can depend on their
9
+ # contents. Which file a toolchain links is its own choice, so every candidate that exists
10
+ # is found. A library only the toolchain's own search paths hold is not found, and a link
11
+ # never depends on a file that doesn't exist, which would read as changed on every build.
12
+ class LibraryResolver
13
+
14
+ # Library extensions toolchains search for beyond a project's own :extension ↳ :libraries
15
+ TOOLCHAIN_EXTENSIONS = ['.a', '.so', '.dylib', '.tbd', '.dll.a', '.lib'].freeze
16
+
17
+ constructor :file_wrapper, :file_path_collection_utils
18
+
19
+ def setup
20
+ @lock = Mutex.new
21
+ @directories = {}
22
+ end
23
+
24
+ # entries: :libraries entries, each a bare name, an `-l:` filename, or a path
25
+ # search_paths: :paths ↳ :libraries, decorated and globbed as configured
26
+ # files: library files known exactly, as a plugin knows those it builds
27
+ def resolve(entries:, search_paths:, files: [])
28
+ return resolve_within( entries, @file_path_collection_utils.collect_paths( search_paths ), files )
29
+ end
30
+
31
+ # The library files a link with these :libraries entries depends on: those the entries
32
+ # resolve to on :paths ↳ :libraries, and those plugins publish in LIBRARIES_LINK_FILES
33
+ def link_files(entries)
34
+ return resolve_within( entries, search_directories(), ((defined? LIBRARIES_LINK_FILES) ? LIBRARIES_LINK_FILES : nil) || [] )
35
+ end
36
+
37
+ # A link's library search path arguments: each directory of search_directories in
38
+ # :libraries ↳ :path_flag
39
+ def search_path_arguments
40
+ directories = search_directories()
41
+ return directories unless defined?( LIBRARIES_PATH_FLAG )
42
+
43
+ return directories.map { |directory| LIBRARIES_PATH_FLAG.gsub( '${1}' ) { directory } }
44
+ end
45
+
46
+ # The directories :paths ↳ :libraries names, decorated and globbed as configured, with
47
+ # those plugins add once configuration is done. Collected once for a set of paths, since
48
+ # every link asks.
49
+ def search_directories
50
+ paths = ((defined? PATHS_LIBRARIES) ? PATHS_LIBRARIES : nil) || []
51
+ return @lock.synchronize { @directories[paths.dup] ||= @file_path_collection_utils.collect_paths( paths ) }
52
+ end
53
+
54
+ private
55
+
56
+ def resolve_within(entries, directories, files)
57
+ candidates = Array( entries ).flatten.compact.flat_map { |entry| candidates_for( entry.to_s, directories ) }
58
+ candidates += Array( files )
59
+
60
+ found = candidates.map { |path| @file_path_collection_utils.shortest_path_from_working( File.expand_path( path ) ) }
61
+ return found.select { |path| library_file?( path ) }.uniq
62
+ end
63
+
64
+ # An `-l:` entry names its exact filename, a path names itself, and a bare name names every
65
+ # library filename a toolchain makes of it
66
+ def candidates_for(entry, directories)
67
+ return within( directories, entry.delete_prefix( ':' ) ) if entry.start_with?( ':' )
68
+ return [entry] if absolute?( entry )
69
+ return [entry] + within( directories, entry ) if path?( entry )
70
+
71
+ return within( directories, *library_filenames( entry ) )
72
+ end
73
+
74
+ def within(directories, *names)
75
+ return directories.product( names ).map { |directory, name| File.join( directory, name ) }
76
+ end
77
+
78
+ def library_filenames(name)
79
+ return ["lib#{name}", name].product( extensions ).map( &:join )
80
+ end
81
+
82
+ # A path, or a filename with a library extension, rather than a name the linker expands
83
+ def path?(entry)
84
+ return entry.match?( %r{[/\\]} ) || extensions.any? { |extension| entry.end_with?( extension ) }
85
+ end
86
+
87
+ def absolute?(entry)
88
+ return File.expand_path( entry ) == entry || entry.match?( %r{\A[A-Za-z]:[/\\]} )
89
+ end
90
+
91
+ def extensions
92
+ @extensions ||= ((defined?( EXTENSION_LIBRARIES ) ? EXTENSION_LIBRARIES.to_a : []) + TOOLCHAIN_EXTENSIONS).uniq
93
+ end
94
+
95
+ def library_file?(path)
96
+ return @file_wrapper.exist?( path ) && !@file_wrapper.directory?( path )
97
+ end
98
+
99
+ end
@@ -87,6 +87,7 @@ configurator_setup:
87
87
  compose:
88
88
  - configurator_builder
89
89
  - configurator_validator
90
+ - configurator_paths_validator
90
91
  - loginator
91
92
  - reportinator
92
93
  - file_wrapper
@@ -101,11 +102,17 @@ configurator_plugins:
101
102
  configurator_validator:
102
103
  compose:
103
104
  - config_walkinator
104
- - file_wrapper
105
105
  - loginator
106
106
  - reportinator
107
107
  - tool_validator
108
108
 
109
+ configurator_paths_validator:
110
+ compose:
111
+ - config_walkinator
112
+ - file_wrapper
113
+ - loginator
114
+ - reportinator
115
+
109
116
  configurator_builder:
110
117
  compose:
111
118
  - file_path_collection_utils
@@ -148,6 +155,10 @@ plugin_reportinator_helper:
148
155
 
149
156
  verbosinator:
150
157
 
158
+ build_log_writer:
159
+ compose:
160
+ - file_wrapper
161
+
151
162
  file_finder:
152
163
  compose:
153
164
  - configurator
@@ -247,7 +258,7 @@ generator_test_results_backtrace:
247
258
  - generator_test_results
248
259
  - generator_helper
249
260
  - file_path_utils
250
- - file_wrapper
261
+ - build_log_writer
251
262
  - loginator
252
263
 
253
264
  generator_test_results_sanity_checker:
@@ -402,6 +413,7 @@ test_invoker:
402
413
  - loginator
403
414
  - verbosinator
404
415
  - test_pipeline_manager
416
+ - include_pathinator
405
417
 
406
418
  test_pipeline_manager:
407
419
  compose:
@@ -434,6 +446,7 @@ test_build_setup:
434
446
  - dependinator
435
447
  - test_search_paths
436
448
  - mock_locator
449
+ - test_source_file_directive_resolver
437
450
 
438
451
  test_includes_extractinator:
439
452
  compose:
@@ -559,6 +572,8 @@ test_build_executor:
559
572
  - gcc_dependency_parser
560
573
  - quote_include_isolator
561
574
  - generator_helper
575
+ - library_resolver
576
+ - mock_locator
562
577
 
563
578
  partials_manager:
564
579
  compose:
@@ -603,6 +618,12 @@ release_build_executor:
603
618
  - file_wrapper
604
619
  - file_path_utils
605
620
  - dependinator
621
+ - library_resolver
622
+
623
+ library_resolver:
624
+ compose:
625
+ - file_wrapper
626
+ - file_path_collection_utils
606
627
 
607
628
  gcc_dependency_parser:
608
629
 
@@ -14,7 +14,7 @@ require 'ceedling/c_extractor/c_extractor'
14
14
  require 'ceedling/c_extractor/c_extractor_constants'
15
15
  require 'ceedling/c_extractor/c_extractor_types'
16
16
  require 'ceedling/constants'
17
- require 'ceedling/path_mirror'
17
+ require 'ceedling/filesystem/path_mirror'
18
18
  require 'ceedling/encodinator'
19
19
 
20
20
  class Partializer
@@ -124,7 +124,7 @@ class Partializer
124
124
  def _find_module_source(_module, header_filepath)
125
125
  return @file_finder.find_source_file(_module, :ignore) if _names_directory?(_module)
126
126
 
127
- subdir = header_filepath.nil? ? '' : PathMirror.relative_subdir(header_filepath, _header_roots)
127
+ subdir = header_filepath.nil? ? '' : PathMirror.relative_subdir_from_clean_roots( header_filepath, _header_roots )
128
128
 
129
129
  unless subdir.empty?
130
130
  found = @file_finder.find_source_file(File.join(subdir, _module), :ignore)
@@ -135,9 +135,9 @@ class Partializer
135
135
  end
136
136
 
137
137
  # Roots a header can sit beneath, which is what its mirrored directory is measured
138
- # against. The same three the project-wide header collection is built from.
138
+ # against: those the project-wide header collection is built from, spelled canonically.
139
139
  def _header_roots
140
- @configurator.paths_test + @configurator.paths_support + @configurator.paths_include
140
+ @configurator.collection_mirror_roots_headers
141
141
  end
142
142
 
143
143
  # Either separator counts. The qualifier validation already rejects a backslash-rooted
@@ -9,6 +9,7 @@ require 'stringio'
9
9
  require 'strscan'
10
10
  require 'ceedling/partials/partials'
11
11
  require 'ceedling/exceptions'
12
+ require 'ceedling/filesystem/project_paths'
12
13
  require 'ceedling/c_extractor/c_extractor_preprocessing'
13
14
  require 'ceedling/encodinator'
14
15
 
@@ -259,7 +260,8 @@ class PartializerConfig
259
260
  _validate_qualifier!( dir, macro_name )
260
261
  _validate_module!( params[1], macro_name, dir: dir )
261
262
 
262
- File.join( dir, params[1] )
263
+ # A `.` segment names nothing, so `./drv` and `drv` name one module
264
+ File.join( *ProjectPaths.segments( dir ), params[1] )
263
265
  end
264
266
 
265
267
  # The module argument names one file's stem and nothing more. The preprocessor emits it
@@ -27,12 +27,10 @@ class ReportLogWriterPlugin < Plugin
27
27
 
28
28
  private
29
29
 
30
- # Ensures <build root>/artifacts/<context>/ exists and returns the full
31
- # filepath for `filename` inside it.
30
+ # Returns the filepath for `filename` beneath <build root>/artifacts/<context>/, with its
31
+ # directory made. A filename named for a test carries the test's subdirectories.
32
32
  def artifact_filepath(context, filename)
33
- path = File.join(PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s)
34
- @file_wrapper.mkdir(path)
35
- File.join(path, filename)
33
+ @file_wrapper.mkdir_for( File.join(PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s, filename) )
36
34
  end
37
35
 
38
36
  # Logs a heading, then either reports `empty_message` or runs the
@@ -6,7 +6,7 @@
6
6
  # =========================================================================
7
7
 
8
8
  require 'rake' # for ext() method
9
- require 'ceedling/file_wrapper'
9
+ require 'ceedling/filesystem/file_wrapper'
10
10
  require 'ceedling/encodinator'
11
11
  require 'ceedling/preprocess/c_preprocessor_conditionals'
12
12
 
@@ -6,7 +6,7 @@
6
6
  # =========================================================================
7
7
 
8
8
  require 'ceedling/includes/includes'
9
- require 'ceedling/path_matcher'
9
+ require 'ceedling/filesystem/path_matcher'
10
10
  require 'ceedling/preprocess/preprocessinator_bare_includes_extractor'
11
11
  require 'ceedling/preprocess/preprocessinator_line_marker_includes_extractor'
12
12
  require 'ceedling/preprocess/c_preprocessor_conditionals'
@@ -6,7 +6,7 @@
6
6
  # =========================================================================
7
7
 
8
8
  require 'ceedling/exceptions'
9
- require 'ceedling/path_matcher'
9
+ require 'ceedling/filesystem/path_matcher'
10
10
  require 'set'
11
11
  require 'stringio'
12
12
 
@@ -6,6 +6,7 @@
6
6
  # =========================================================================
7
7
 
8
8
  require 'ceedling/constants'
9
+ require 'ceedling/filesystem/project_paths'
9
10
 
10
11
  # Resolves the ordered list of .rake files Ceedling will load for a given project
11
12
  # configuration. Callable from both bin/ (early, before do_setup) and lib/ (within
@@ -39,8 +40,11 @@ module RakefileComponentResolver
39
40
  # plugins path last. This ordering lets user plugins shadow built-in plugins of the
40
41
  # same name. Used by both resolve() (bin/ CLI scope) and Configurator#prepare_plugins_load_paths
41
42
  # (application scope) so both scopes search plugins in the same priority order.
42
- def prepare_plugin_load_paths(config, ceedling_plugins_path)
43
- load_paths = Array( config.dig(:plugins, :load_paths) ).dup
43
+ #
44
+ # `expand` applies inline Ruby string expansion to each configured path, and each is then
45
+ # standardized as every other configured path is, so both scopes read them alike.
46
+ def prepare_plugin_load_paths(config, ceedling_plugins_path, expand: ->(path) { path })
47
+ load_paths = Array( config.dig(:plugins, :load_paths) ).compact.map { |path| ProjectPaths.standardize( expand.call( path ) ) }
44
48
  load_paths << ceedling_plugins_path
45
49
  load_paths.compact!
46
50
  load_paths.uniq!
@@ -51,7 +55,7 @@ module RakefileComponentResolver
51
55
  # - Stock files (always)
52
56
  # - Conditional stock files (rules_release, tasks_release if release_build is enabled)
53
57
  # - Plugin .rake files (first matching <root>/<plugin>/<plugin>.rake across load_paths)
54
- def resolve(config, ceedling_lib_path, ceedling_plugins_path)
58
+ def resolve(config, ceedling_lib_path, ceedling_plugins_path, expand: ->(path) { path })
55
59
  paths = base_rakefiles(ceedling_lib_path) + test_rakefiles(ceedling_lib_path)
56
60
 
57
61
  if config.dig(:project, :release_build)
@@ -59,7 +63,7 @@ module RakefileComponentResolver
59
63
  end
60
64
 
61
65
  paths.concat(
62
- plugin_rake_files( config, prepare_plugin_load_paths(config, ceedling_plugins_path) )
66
+ plugin_rake_files( config, prepare_plugin_load_paths(config, ceedling_plugins_path, expand: expand) )
63
67
  )
64
68
 
65
69
  return paths
@@ -70,20 +74,9 @@ module RakefileComponentResolver
70
74
  # Uses File.exist? directly (no DI needed) — same check as ConfiguratorPlugins#find_rake_plugins.
71
75
  # Array() wraps nil gracefully so missing config keys don't raise.
72
76
  def plugin_rake_files(config, load_paths)
73
- enabled = Array( config.dig(:plugins, :enabled) )
74
- results = []
75
-
76
- enabled.each do |plugin|
77
- load_paths.each do |load_path|
78
- candidate = File.join(load_path, plugin, "#{plugin}.rake")
79
- if File.exist?(candidate)
80
- results << candidate
81
- break
82
- end
83
- end
77
+ return Array( config.dig(:plugins, :enabled) ).filter_map do |plugin|
78
+ load_paths.lazy.map { |load_path| File.join(load_path, plugin, "#{plugin}.rake") }.find { |candidate| File.exist?(candidate) }
84
79
  end
85
-
86
- results
87
80
  end
88
81
 
89
82
  end
@@ -0,0 +1,29 @@
1
+ # =========================================================================
2
+ # Ceedling - Test-Centered Build System for C
3
+ # ThrowTheSwitch.org
4
+ # Copyright (c) 2010-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
5
+ # SPDX-License-Identifier: MIT
6
+ # =========================================================================
7
+
8
+ # Turns a per-file test task's name (test:, gen:mocks:, gcov:, valgrind:, and the rest) into
9
+ # the test name file lookup needs. A directory typed ahead of the name tells same-named tests
10
+ # apart, so it is kept, and only the file name gets the test file prefix.
11
+ module TestTaskName
12
+
13
+ def self.test_name(task_name, root:, extensions: EXTENSION_SOURCE, prefix: PROJECT_TEST_FILE_PREFIX)
14
+ test = task_name.strip.delete_prefix( root )
15
+
16
+ # At most one configured extension ends the name, so trying each in turn is safe
17
+ extensions.each { |ext| test = test.chomp( ext ) }
18
+
19
+ # A Windows-style name under a POSIX Ruby (WSL, Cygwin) has backslashes File won't split on
20
+ test = test.tr( '\\', '/' )
21
+
22
+ dir = File.dirname( test )
23
+ base = File.basename( test )
24
+ base = prefix + base unless base.start_with?( prefix )
25
+
26
+ return (dir == '.') ? base : File.join( dir, base )
27
+ end
28
+
29
+ end
@@ -5,6 +5,18 @@
5
5
  # SPDX-License-Identifier: MIT
6
6
  # =========================================================================
7
7
 
8
+ # A launcher before 1.2.2 loads this application into its own process, where its code
9
+ # mixes with this installation's. Before anything else loads, restart in this
10
+ # installation's own process. require_relative, because such a launcher's load path
11
+ # cannot reach files newer than itself.
12
+ require_relative 'handoff'
13
+ Handoff.complete_in_process(
14
+ app_root: File.expand_path( File.join( __dir__, '..', '..' ) ),
15
+ app_cfg: CEEDLING_APPCFG,
16
+ handoff_objects: CEEDLING_HANDOFF_OBJECTS,
17
+ env: ENV
18
+ )
19
+
8
20
  require 'fileutils'
9
21
 
10
22
  # Add Unity and CMock's Ruby code paths to $LOAD_PATH for runner generation and mocking
@@ -23,6 +35,7 @@ Rake::TaskManager.record_task_metadata = true
23
35
 
24
36
  require 'ceedling/system_wrapper'
25
37
  require 'ceedling/reportinator'
38
+ require 'ceedling/rake_app/test_task_name'
26
39
 
27
40
  # Operation duration logging
28
41
  def log_runtime(run, start_time_s, end_time_s, enabled)
@@ -48,7 +61,9 @@ begin
48
61
  # 1. Add full path to $LOAD_PATH to simplify objects.yml
49
62
  # 2. Perform object construction + dependency injection
50
63
  # 3. Remove full path from $LOAD_PATH
51
- $LOAD_PATH.unshift( CEEDLING_APPCFG[:ceedling_lib_path] )
64
+ # The full path comes last, behind its subdirectories, so a file an older Ceedling left
65
+ # directly in lib/ceedling/ never stands in for one that has moved below it
66
+ $LOAD_PATH.push( CEEDLING_APPCFG[:ceedling_lib_path] )
52
67
  objects_filepath = File.join( CEEDLING_APPCFG[:ceedling_lib_path], 'objects.yml' )
53
68
 
54
69
  # Create object hash and dependency injection context
@@ -6,7 +6,7 @@
6
6
  # =========================================================================
7
7
 
8
8
  require 'ceedling/constants'
9
- require 'ceedling/file_path_utils'
9
+ require 'ceedling/filesystem/file_path_utils'
10
10
 
11
11
  # Set Rake verbosity using global constant verbosity set before Rake is loaded
12
12
  if !!defined?(PROJECT_VERBOSITY)
@@ -21,11 +21,9 @@ namespace RELEASE_SYM do
21
21
  # Use rules to increase efficiency for large projects (instead of iterating through all sources and creating defined tasks)
22
22
 
23
23
  # Unadvertised Rake task to execute source file compilation in isolation.
24
- # A source extension can be configured as more than one string, so each one escaped
25
- # and joined into the pattern's alternation is what lets a task name ending in any of
26
- # them match, rather than only the first/primary one.
27
- release_source_extensions = EXTENSION_SOURCE.to_a.map { |ext| Regexp.escape(ext) }.join('|')
28
- rule(/^#{RELEASE_COMPILE_TASK_ROOT}\S+(?:#{release_source_extensions}|#{Regexp.escape(EXTENSION_CORE_SOURCE)})$/ => [ # compile task names by regex
24
+ # A source extension can be configured as more than one string, so a task name ending in
25
+ # any of them matches, rather than only the first/primary one.
26
+ rule(/^#{RELEASE_COMPILE_TASK_ROOT}\S+(?:#{EXTENSION_SOURCE.pattern}|#{Regexp.escape(EXTENSION_CORE_SOURCE)})$/ => [ # compile task names by regex
29
27
  proc do |task_name|
30
28
  source = task_name.sub(/#{RELEASE_COMPILE_TASK_ROOT}/, '')
31
29
  @ceedling[:file_finder].find_source_file(source)
@@ -37,8 +35,7 @@ namespace RELEASE_SYM do
37
35
 
38
36
  # Unadvertised Rake task to execute source file assembly in isolation
39
37
  if (RELEASE_BUILD_USE_ASSEMBLY)
40
- release_assembly_extensions = EXTENSION_ASSEMBLY.to_a.map { |ext| Regexp.escape(ext) }.join('|')
41
- rule(/^#{RELEASE_ASSEMBLE_TASK_ROOT}\S+(?:#{release_assembly_extensions})$/ => [ # assemble task names by regex
38
+ rule(/^#{RELEASE_ASSEMBLE_TASK_ROOT}\S+#{EXTENSION_ASSEMBLY.pattern}$/ => [ # assemble task names by regex
42
39
  proc do |task_name|
43
40
  source = task_name.sub(/#{RELEASE_ASSEMBLE_TASK_ROOT}/, '')
44
41
  @ceedling[:file_finder].find_assembly_file(source)
@@ -9,26 +9,9 @@ namespace TEST_SYM do
9
9
  # Use rules to increase efficiency for large projects (instead of iterating through all sources and creating defined tasks)
10
10
  rule(/^#{TEST_TASK_ROOT}\S+$/ => [ # Test task names by regex
11
11
  proc do |task_name|
12
- # Yield clean test name => Strip the task string, remove Rake test task prefix, and remove any code file extension.
13
- # Only one configured source extension can actually be present at the end of a given
14
- # task name, so trying each in turn is safe -- chomp is a no-op for the ones that don't match.
15
- # Whatever directory the invoker typed ahead of the name (e.g. `test:unit/test_foo.c`)
16
- # is left exactly as given -- it's not decoration, it's what disambiguates one test
17
- # from another same-named test elsewhere in the project.
18
- test = task_name.strip().sub(/^#{TEST_TASK_ROOT}/, '')
19
- EXTENSION_SOURCE.each { |ext| test = test.chomp( ext ) }
20
-
21
- # Normalized to forward slashes so a directory the invoker typed with backslashes
22
- # (a Windows-style task name run under a POSIX Ruby, e.g. WSL or Cygwin, where
23
- # File.dirname/basename below don't treat '\' as a separator) still splits correctly.
24
- test = test.tr( '\\', '/' )
25
-
26
- # Ensure the test name's own basename begins with the test file prefix, without
27
- # disturbing any directory the invoker supplied ahead of it.
28
- dir = File.dirname( test )
29
- base = File.basename( test )
30
- base = PROJECT_TEST_FILE_PREFIX + base if not (base.start_with?( PROJECT_TEST_FILE_PREFIX ))
31
- test = (dir == '.') ? base : File.join( dir, base )
12
+ # Any directory typed ahead of the name (e.g. `test:unit/test_foo.c`) is kept, since it
13
+ # tells one test from a same-named test elsewhere. See TestTaskName.
14
+ test = TestTaskName.test_name( task_name, root: TEST_TASK_ROOT )
32
15
 
33
16
  # Provide the filepath for the target test task back to the Rake task
34
17
  @ceedling[:file_finder].find_test_file_from_name( test )
@@ -21,26 +21,9 @@ namespace GEN_SYM do
21
21
  # Use a rule to increase efficiency for large projects (instead of iterating through all sources and creating defined tasks)
22
22
  rule(/^#{GENERATE_MOCKS_TASK_ROOT}\S+$/ => [ # Task names by regex
23
23
  proc do |task_name|
24
- # Yield clean test name => Strip the task string, remove Rake task prefix, and remove any code file extension.
25
- # Only one configured source extension can actually be present at the end of a given
26
- # task name, so trying each in turn is safe -- chomp is a no-op for the ones that don't match.
27
- # Whatever directory the invoker typed ahead of the name (e.g. `gen:mocks:unit/foo.c`)
28
- # is left exactly as given -- it's not decoration, it's what disambiguates one test
29
- # from another same-named test elsewhere in the project.
30
- test = task_name.strip().sub(/^#{GENERATE_MOCKS_TASK_ROOT}/, '')
31
- EXTENSION_SOURCE.each { |ext| test = test.chomp( ext ) }
32
-
33
- # Normalized to forward slashes so a directory the invoker typed with backslashes
34
- # (a Windows-style task name run under a POSIX Ruby, e.g. WSL or Cygwin, where
35
- # File.dirname/basename below don't treat '\' as a separator) still splits correctly.
36
- test = test.tr( '\\', '/' )
37
-
38
- # Ensure the test name's own basename begins with the test file prefix, without
39
- # disturbing any directory the invoker supplied ahead of it.
40
- dir = File.dirname( test )
41
- base = File.basename( test )
42
- base = PROJECT_TEST_FILE_PREFIX + base if not (base.start_with?( PROJECT_TEST_FILE_PREFIX ))
43
- test = (dir == '.') ? base : File.join( dir, base )
24
+ # Any directory typed ahead of the name (e.g. `gen:mocks:unit/foo.c`) is kept, since it
25
+ # tells one test from a same-named test elsewhere. See TestTaskName.
26
+ test = TestTaskName.test_name( task_name, root: GENERATE_MOCKS_TASK_ROOT )
44
27
 
45
28
  # Provide the filepath for the target test task back to the Rake task
46
29
  @ceedling[:file_finder].find_test_file_from_name( test )
@@ -56,16 +39,7 @@ namespace GEN_SYM do
56
39
  # Use a rule to increase efficiency for large projects (instead of iterating through all sources and creating defined tasks)
57
40
  rule(/^#{GENERATE_TEST_RUNNER_TASK_ROOT}\S+$/ => [ # Task names by regex
58
41
  proc do |task_name|
59
- # See gen:mocks's identical rule above for a full explanation of this resolution.
60
- test = task_name.strip().sub(/^#{GENERATE_TEST_RUNNER_TASK_ROOT}/, '')
61
- EXTENSION_SOURCE.each { |ext| test = test.chomp( ext ) }
62
-
63
- test = test.tr( '\\', '/' )
64
-
65
- dir = File.dirname( test )
66
- base = File.basename( test )
67
- base = PROJECT_TEST_FILE_PREFIX + base if not (base.start_with?( PROJECT_TEST_FILE_PREFIX ))
68
- test = (dir == '.') ? base : File.join( dir, base )
42
+ test = TestTaskName.test_name( task_name, root: GENERATE_TEST_RUNNER_TASK_ROOT )
69
43
 
70
44
  @ceedling[:file_finder].find_test_file_from_name( test )
71
45
  end