ceedling 1.2.1 → 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.
- checksums.yaml +4 -4
- data/GIT_COMMIT_SHA +1 -1
- data/README.md +11 -9
- data/Rakefile +2 -1
- data/assets/features/ceedling +1 -1
- data/assets/fixtures/test_source_file_duplicate_basenames/test_calc_typo.c +14 -0
- data/assets/fixtures/tests_with_duplicate_test_names/test_foo.c +21 -0
- data/assets/fixtures/tests_with_partials_coverage/src/private_macro.c +7 -0
- data/assets/fixtures/tests_with_partials_coverage/src/private_macro.h +5 -0
- data/assets/fixtures/tests_with_partials_coverage/src/tally.c +13 -0
- data/assets/fixtures/tests_with_partials_coverage/src/tally.h +4 -0
- data/assets/fixtures/tests_with_partials_coverage/test/test_private_macro.c +10 -0
- data/assets/fixtures/tests_with_partials_coverage/test/test_tally.c +9 -0
- data/bin/actionator.rb +6 -12
- data/bin/app_cfg.rb +14 -1
- data/bin/ceedling +13 -3
- data/bin/cli.rb +25 -6
- data/bin/cli_handler.rb +113 -73
- data/bin/cli_helper.rb +51 -78
- data/bin/installation_selector.rb +81 -0
- data/bin/launchinator.rb +69 -0
- data/bin/mixin_resolvinator.rb +26 -36
- data/bin/objects.yml +13 -0
- data/bin/path_validator.rb +25 -29
- data/bin/versionator.rb +47 -48
- data/ceedling.gemspec +19 -15
- data/docs/BreakingChanges.md +86 -1
- data/docs/Changelog.md +145 -3
- data/docs/KnownIssues.md +179 -6
- data/docs/ReleaseNotes.md +13 -0
- data/examples/wondrous_forest/README.md +29 -1
- data/examples/wondrous_forest/src/ForestUnits.h +23 -0
- data/examples/wondrous_forest/src/RainGauge.c +59 -0
- data/examples/wondrous_forest/src/RainGauge.h +39 -0
- data/examples/wondrous_forest/src/RainTipIsr.c +17 -0
- data/examples/wondrous_forest/src/RainTipIsr.h +14 -0
- data/examples/wondrous_forest/test/TestRainGauge.c +126 -0
- data/lib/ceedling/build_log_writer.rb +33 -0
- data/lib/ceedling/c_extractor/README.md +15 -7
- data/lib/ceedling/c_extractor/c_extractor.rb +25 -14
- data/lib/ceedling/c_extractor/c_extractor_code_text.rb +84 -54
- data/lib/ceedling/c_extractor/c_extractor_constants.rb +18 -7
- data/lib/ceedling/c_extractor/c_extractor_declarations.rb +319 -283
- data/lib/ceedling/c_extractor/c_extractor_declarator.rb +285 -0
- data/lib/ceedling/c_extractor/c_extractor_defined_type.rb +111 -0
- data/lib/ceedling/c_extractor/c_extractor_definitions.rb +174 -121
- data/lib/ceedling/c_extractor/c_extractor_functions.rb +191 -162
- data/lib/ceedling/c_extractor/c_extractor_preprocessing.rb +46 -55
- data/lib/ceedling/c_extractor/c_extractor_statement.rb +30 -0
- data/lib/ceedling/c_extractor/c_extractor_types.rb +63 -41
- data/lib/ceedling/c_extractor/c_module_edits.rb +48 -0
- data/lib/ceedling/c_identifier.rb +21 -0
- data/lib/ceedling/ceedling.h +8 -0
- data/lib/ceedling/config/build_root_policy.rb +70 -0
- data/lib/ceedling/config/configurator.rb +18 -19
- data/lib/ceedling/config/configurator_builder.rb +75 -28
- data/lib/ceedling/config/configurator_paths_validator.rb +179 -0
- data/lib/ceedling/config/configurator_plugins.rb +1 -1
- data/lib/ceedling/config/configurator_setup.rb +44 -33
- data/lib/ceedling/config/configurator_validator.rb +1 -110
- data/lib/ceedling/constants.rb +5 -1
- data/lib/ceedling/defaults.rb +35 -5
- data/lib/ceedling/dependencies/CACHE_SCHEMA.md +118 -0
- data/lib/ceedling/dependencies/README.md +18 -16
- data/lib/ceedling/dependencies/dependency_cache_store.rb +43 -21
- data/lib/ceedling/dependencies/dependency_hasher.rb +35 -1
- data/lib/ceedling/dependencies/dependency_tracker.rb +9 -3
- data/lib/ceedling/dependencies/dependinator.rb +13 -1
- data/lib/ceedling/diagnostics/DOCTOR.md +142 -0
- data/lib/ceedling/diagnostics/README.md +5 -0
- data/lib/ceedling/diagnostics/build_step_doctor.rb +110 -0
- data/lib/ceedling/diagnostics/duplicate_symbol_specialist.rb +108 -0
- data/lib/ceedling/diagnostics/guidance_phrases.rb +30 -0
- data/lib/ceedling/diagnostics/header_collision_guidance.rb +56 -0
- data/lib/ceedling/diagnostics/header_collision_specialist.rb +152 -0
- data/lib/ceedling/diagnostics/include_depth_specialist.rb +132 -0
- data/lib/ceedling/diagnostics/missing_symbol_specialist.rb +111 -0
- data/lib/ceedling/diagnostics/partial_name_specialist.rb +134 -0
- data/lib/ceedling/diagnostics/toolchain_output.rb +44 -0
- data/lib/ceedling/filename_extension.rb +7 -1
- data/lib/ceedling/filesystem/FILE_TREE.md +253 -0
- data/lib/ceedling/filesystem/PATH_HANDLING.md +360 -0
- data/lib/ceedling/filesystem/README.md +46 -0
- data/lib/ceedling/filesystem/build_roots.rb +105 -0
- data/lib/ceedling/filesystem/build_subpath.rb +187 -0
- data/lib/ceedling/filesystem/destination_collision.rb +25 -0
- data/lib/ceedling/{file_finder.rb → filesystem/file_finder.rb} +177 -156
- data/lib/ceedling/filesystem/file_finder_helper.rb +154 -0
- data/lib/ceedling/filesystem/file_path_collection_utils.rb +183 -0
- data/lib/ceedling/{file_path_utils.rb → filesystem/file_path_utils.rb} +200 -167
- data/lib/ceedling/{file_system_wrapper.rb → filesystem/file_system_wrapper.rb} +6 -5
- data/lib/ceedling/filesystem/file_tree.rb +241 -0
- data/lib/ceedling/{file_wrapper.rb → filesystem/file_wrapper.rb} +149 -65
- data/lib/ceedling/filesystem/path_exclusions.rb +30 -0
- data/lib/ceedling/{path_matcher.rb → filesystem/path_matcher.rb} +48 -23
- data/lib/ceedling/{path_mirror.rb → filesystem/path_mirror.rb} +19 -18
- data/lib/ceedling/filesystem/path_spellings.rb +55 -0
- data/lib/ceedling/filesystem/project_paths.rb +184 -0
- data/lib/ceedling/filesystem/test_build_layout.rb +114 -0
- data/lib/ceedling/filesystem/win_long_paths.rb +153 -0
- data/lib/ceedling/filesystem/win_path_limit.rb +83 -0
- data/lib/ceedling/filesystem/win_path_prober.rb +52 -0
- data/lib/ceedling/filesystem/working_dir.rb +40 -0
- data/lib/ceedling/generators/generator.rb +32 -70
- data/lib/ceedling/generators/generator_helper.rb +0 -44
- data/lib/ceedling/generators/generator_mocks.rb +5 -0
- data/lib/ceedling/generators/generator_partials.rb +306 -244
- data/lib/ceedling/generators/generator_test_results_backtrace.rb +7 -7
- data/lib/ceedling/generators/generator_test_runner.rb +5 -8
- data/lib/ceedling/generators/partial_header_writer.rb +95 -0
- data/lib/ceedling/generators/partial_source_writer.rb +137 -0
- data/lib/ceedling/handoff.rb +121 -0
- data/lib/ceedling/includes/header_search.rb +225 -0
- data/lib/ceedling/includes/include_factory.rb +9 -12
- data/lib/ceedling/includes/include_pathinator.rb +112 -33
- data/lib/ceedling/includes/includes.rb +150 -38
- data/lib/ceedling/installation.rb +92 -0
- data/lib/ceedling/library_resolver.rb +99 -0
- data/lib/ceedling/objects.yml +112 -6
- data/lib/ceedling/partials/README.md +110 -16
- data/lib/ceedling/partials/carry_plan.rb +71 -0
- data/lib/ceedling/partials/definition_head.rb +74 -0
- data/lib/ceedling/partials/include_groups.rb +37 -0
- data/lib/ceedling/partials/interface_extras.rb +25 -0
- data/lib/ceedling/partials/partializer.rb +603 -124
- data/lib/ceedling/partials/partializer_config.rb +8 -1
- data/lib/ceedling/partials/partializer_helper.rb +851 -145
- data/lib/ceedling/partials/partializer_reconciler.rb +174 -0
- data/lib/ceedling/partials/partializer_utils.rb +89 -109
- data/lib/ceedling/partials/partials.rb +153 -10
- data/lib/ceedling/partials/type_macros.rb +126 -0
- data/lib/ceedling/plugins/report_log_writer_plugin.rb +3 -5
- data/lib/ceedling/preprocess/README.md +43 -33
- data/lib/ceedling/preprocess/preprocessinator.rb +100 -186
- data/lib/ceedling/preprocess/preprocessinator_code_finder.rb +65 -72
- data/lib/ceedling/preprocess/preprocessinator_file_assembler.rb +32 -76
- data/lib/ceedling/preprocess/preprocessinator_includes_handler.rb +1 -1
- data/lib/ceedling/preprocess/preprocessinator_line_marker_includes_extractor.rb +1 -1
- data/lib/ceedling/preprocess/preprocessinator_reconstructor.rb +51 -14
- data/lib/ceedling/rake_app/rakefile_component_resolver.rb +10 -17
- data/lib/ceedling/rakefile.rb +15 -1
- data/lib/ceedling/rakefiles/base/tasks_base.rake +1 -1
- data/lib/ceedling/rakefiles/release/rules_release.rake +4 -7
- data/lib/ceedling/release_invoker/release_build_executor.rb +33 -44
- data/lib/ceedling/release_invoker/release_build_planner.rb +14 -6
- data/lib/ceedling/reportinator.rb +3 -4
- data/lib/ceedling/setupinator.rb +104 -87
- data/lib/ceedling/test_context_extractor.rb +5 -1
- data/lib/ceedling/test_invoker/HEADER_COLLISIONS.md +21 -7
- data/lib/ceedling/test_invoker/PIPELINE.md +62 -19
- data/lib/ceedling/test_invoker/README.md +1 -1
- data/lib/ceedling/test_invoker/derived_search_path_notices.rb +45 -0
- data/lib/ceedling/test_invoker/mock_locator.rb +175 -10
- data/lib/ceedling/test_invoker/partial_files_preprocessinator.rb +181 -0
- data/lib/ceedling/test_invoker/partials_manager.rb +271 -302
- data/lib/ceedling/test_invoker/standin_headerinator.rb +19 -17
- data/lib/ceedling/test_invoker/test_bare_includes_extractinator.rb +26 -3
- data/lib/ceedling/test_invoker/test_build_executor.rb +358 -234
- data/lib/ceedling/test_invoker/test_build_planner.rb +46 -33
- data/lib/ceedling/test_invoker/test_build_setup.rb +43 -18
- data/lib/ceedling/test_invoker/test_build_validations.rb +35 -47
- data/lib/ceedling/test_invoker/test_derived_search_paths.rb +189 -0
- data/lib/ceedling/test_invoker/test_file_preprocessinator.rb +2 -3
- data/lib/ceedling/test_invoker/test_includes_reconcilinator.rb +1 -1
- data/lib/ceedling/test_invoker/test_invoker.rb +6 -1
- data/lib/ceedling/test_invoker/test_invoker_types.rb +28 -20
- data/lib/ceedling/test_invoker/test_pipeline_helpers.rb +6 -4
- data/lib/ceedling/test_invoker/test_pipeline_manager.rb +25 -8
- data/lib/ceedling/test_invoker/test_runner_generatinator.rb +31 -3
- data/lib/ceedling/test_invoker/test_search_paths.rb +30 -8
- data/lib/ceedling/test_invoker/test_source_file_directive_resolver.rb +40 -20
- data/lib/ceedling/test_invoker/test_substitutions.rb +72 -0
- data/lib/ceedling/tools/shell_quoting.rb +45 -0
- data/lib/ceedling/{tool_executor.rb → tools/tool_executor.rb} +9 -3
- data/lib/ceedling/tools/tool_quoting.rb +79 -0
- data/lib/ceedling/{tool_validator.rb → tools/tool_validator.rb} +18 -7
- data/lib/ceedling/yaml_wrapper.rb +3 -2
- data/lib/version.rb +1 -1
- data/plugins/bullseye/bullseye.rake +1 -3
- data/plugins/bullseye/config/defaults_bullseye.rb +1 -1
- data/plugins/bullseye/lib/bullseye.rb +24 -9
- data/plugins/command_hooks/lib/command_hooks.rb +1 -1
- data/plugins/cppcheck/config/defaults_cppcheck.rb +1 -1
- data/plugins/dependencies/config/defaults.yml +6 -6
- data/plugins/dependencies/dependencies.rake +4 -1
- data/plugins/dependencies/lib/dependencies.rb +18 -8
- data/plugins/dependencies/lib/dependency_spec.rb +17 -5
- data/plugins/fff/lib/fff.rb +79 -46
- data/plugins/fff/lib/fff_mock_generator.rb +12 -9
- data/plugins/fff/spec/fff_cmock_wrapper_spec.rb +262 -0
- data/plugins/fff/spec/fff_mock_header_generator_spec.rb +9 -0
- data/plugins/fff/spec/fff_mock_source_generator_spec.rb +20 -0
- data/plugins/gcov/config/defaults_gcov.rb +1 -1
- data/plugins/gcov/lib/console_reportinator.rb +28 -36
- data/plugins/gcov/lib/gcov.rb +9 -2
- data/plugins/gcov/lib/gcovr_reportinator.rb +8 -40
- data/plugins/gcov/lib/gcovr_thresholds.rb +74 -0
- data/plugins/gcov/lib/reportgenerator_reportinator.rb +3 -2
- data/plugins/module_generator/lib/module_generator.rb +3 -3
- data/plugins/report_tests_teamcity_stdout/lib/report_tests_teamcity_stdout.rb +53 -80
- data/plugins/sanitize/lib/sanitize_records.rb +3 -6
- data/plugins/valgrind/lib/valgrind.rb +14 -7
- data/site-local/404.html +2 -2
- data/site-local/assets/javascripts/{bundle.c21346df.min.js → bundle.a5f9d56c.min.js} +1 -1
- data/site-local/assets/javascripts/{bundle.c21346df.min.js.map → bundle.a5f9d56c.min.js.map} +2 -2
- data/site-local/configuration/environment-vars.html +2 -2
- data/site-local/configuration/global-collections.html +3 -3
- data/site-local/configuration/index.html +2 -2
- data/site-local/configuration/loading.html +2 -2
- data/site-local/configuration/mixins.html +2 -2
- data/site-local/configuration/parallel-builds.html +2 -2
- data/site-local/configuration/project-file.html +2 -2
- data/site-local/configuration/reference/cexception.html +2 -2
- data/site-local/configuration/reference/cmock.html +7 -3
- data/site-local/configuration/reference/defines.html +2 -2
- data/site-local/configuration/reference/environment.html +2 -2
- data/site-local/configuration/reference/extension.html +2 -2
- data/site-local/configuration/reference/files.html +65 -12
- data/site-local/configuration/reference/flags.html +2 -2
- data/site-local/configuration/reference/index.html +2 -2
- data/site-local/configuration/reference/libraries.html +23 -5
- data/site-local/configuration/reference/mixins.html +2 -2
- data/site-local/configuration/reference/partials.html +84 -2
- data/site-local/configuration/reference/paths.html +36 -8
- data/site-local/configuration/reference/plugins.html +2 -2
- data/site-local/configuration/reference/project.html +264 -12
- data/site-local/configuration/reference/release-build.html +4 -2
- data/site-local/configuration/reference/test-build.html +2 -2
- data/site-local/configuration/reference/test-runner.html +2 -2
- data/site-local/configuration/reference/tools.html +58 -4
- data/site-local/configuration/reference/unity.html +2 -2
- data/site-local/configuration/which-ceedling.html +379 -19
- data/site-local/development/index.html +2 -2
- data/site-local/development/plugins/configuration.html +2 -2
- data/site-local/development/plugins/index.html +2 -2
- data/site-local/development/plugins/plugin-subclass.html +5 -4
- data/site-local/development/plugins/rake-tasks.html +2 -2
- data/site-local/development/releases.html +7 -3
- data/site-local/development/workflow.html +50 -45
- data/site-local/getting-started/builds.html +4 -2
- data/site-local/getting-started/command-line.html +58 -6
- data/site-local/getting-started/example-projects/cipher-quest.html +2 -2
- data/site-local/getting-started/example-projects/index.html +2 -2
- data/site-local/getting-started/example-projects/temp-sensor.html +2 -2
- data/site-local/getting-started/example-projects/wondrous-forest.html +10 -2
- data/site-local/getting-started/index.html +2 -2
- data/site-local/getting-started/installation.html +2 -2
- data/site-local/getting-started/quick-start.html +2 -2
- data/site-local/help.html +2 -2
- data/site-local/index.html +2 -2
- data/site-local/overview/build-system.html +2 -2
- data/site-local/overview/index.html +2 -2
- data/site-local/overview/test-environments.html +2 -2
- data/site-local/overview/tools-and-frameworks.html +2 -2
- data/site-local/plugins/beep.html +2 -2
- data/site-local/plugins/bullseye/index.html +45 -38
- data/site-local/plugins/bullseye/licensing.html +2 -2
- data/site-local/plugins/command-hooks.html +4 -4
- data/site-local/plugins/compile-commands-json-db.html +2 -2
- data/site-local/plugins/cppcheck.html +2 -2
- data/site-local/plugins/dependencies.html +8 -5
- data/site-local/plugins/fff.html +58 -13
- data/site-local/plugins/gcov/examples.html +2 -2
- data/site-local/plugins/gcov/gcovr.html +23 -14
- data/site-local/plugins/gcov/index.html +2 -2
- data/site-local/plugins/gcov/overview.html +2 -2
- data/site-local/plugins/gcov/reportgenerator.html +18 -14
- data/site-local/plugins/gcov/reporting.html +2 -2
- data/site-local/plugins/gcov/setup.html +4 -3
- data/site-local/plugins/gcov/tool-versions.html +2 -2
- data/site-local/plugins/gcov/troubleshooting.html +2 -2
- data/site-local/plugins/index.html +2 -2
- data/site-local/plugins/module-generator.html +2 -2
- data/site-local/plugins/report-build-warnings-log.html +2 -2
- data/site-local/plugins/report-tests-gtestlike-stdout.html +2 -2
- data/site-local/plugins/report-tests-ide-stdout.html +2 -2
- data/site-local/plugins/report-tests-log-factory.html +2 -2
- data/site-local/plugins/report-tests-pretty-stdout.html +2 -2
- data/site-local/plugins/report-tests-raw-output-log.html +5 -3
- data/site-local/plugins/report-tests-teamcity-stdout.html +8 -5
- data/site-local/plugins/sanitize.html +9 -8
- data/site-local/plugins/valgrind.html +10 -9
- data/site-local/project/index.html +2 -2
- data/site-local/project/release-history.html +2 -2
- data/site-local/project/sbom.html +2 -2
- data/site-local/project/upgrade.html +5 -2
- data/site-local/reference/build-directives.html +2 -2
- data/site-local/reference/command-line.html +11 -4
- data/site-local/reference/environment-vars.html +2 -2
- data/site-local/reference/gcov-plugin.html +2 -2
- data/site-local/reference/global-collections.html +12 -12
- data/site-local/reference/index.html +2 -2
- data/site-local/reference/partials-macros.html +47 -2
- data/site-local/reference/project-configuration.html +2 -2
- data/site-local/sitemap.xml.gz +0 -0
- data/site-local/snapshot/examples/cipher_quest/index.html +2 -2
- data/site-local/snapshot/examples/temp_sensor/index.html +2 -2
- data/site-local/snapshot/examples/wondrous_forest/index.html +72 -15
- data/site-local/snapshot/plugins/bullseye/config/defaults_bullseye.rb +1 -1
- data/site-local/snapshot/plugins/gcov/config/defaults_gcov.rb +1 -1
- data/site-local/testing-guide/build-directives.html +2 -2
- data/site-local/testing-guide/conventions.html +113 -15
- data/site-local/testing-guide/frameworks.html +2 -2
- data/site-local/testing-guide/index.html +2 -2
- data/site-local/testing-guide/partials/configuration.html +31 -4
- data/site-local/testing-guide/partials/conventions.html +509 -8
- data/site-local/testing-guide/partials/directives.html +4 -3
- data/site-local/testing-guide/partials/example.html +2 -2
- data/site-local/testing-guide/partials/index.html +2 -2
- data/site-local/testing-guide/partials/overview.html +30 -12
- data/site-local/testing-guide/partials/variables.html +169 -4
- data/site-local/testing-guide/test-cases.html +2 -2
- data/site-local/testing-guide/test-sample.html +2 -2
- data/site-local/testing-guide/test-suite-anatomy.html +2 -2
- data/spec/integration/actionator_file_operations_spec.rb +91 -1
- data/spec/integration/build_step_doctor_spec.rb +270 -0
- data/spec/integration/c_extractor_composition_spec.rb +254 -4
- data/spec/integration/compile_commands_json_db_spec.rb +1 -1
- data/spec/integration/configurator_validation_spec.rb +1 -1
- data/spec/integration/dependencies/dependency_tracker_cache_hardening_spec.rb +26 -0
- data/spec/integration/dependencies/dependency_tracker_core_spec.rb +22 -0
- data/spec/integration/includes_extraction_spec.rb +27 -14
- data/spec/integration/launcher_handoff_spec.rb +297 -0
- data/spec/integration/mixin_loading_spec.rb +1 -1
- data/spec/integration/module_generator_spec.rb +3 -3
- data/spec/integration/nested_test_artifacts_spec.rb +99 -0
- data/spec/integration/partial_files_preprocessing_spec.rb +128 -0
- data/spec/integration/partials_carry_spec.rb +520 -0
- data/spec/integration/partials_declarations_spec.rb +655 -0
- data/spec/integration/partials_fallback_preprocessing_spec.rb +65 -0
- data/spec/integration/partials_function_pointers_spec.rb +277 -0
- data/spec/integration/partials_header_composition_spec.rb +268 -35
- data/spec/integration/partials_macro_decorators_spec.rb +267 -0
- data/spec/integration/partials_module_resolution_spec.rb +33 -23
- data/spec/integration/partials_symbol_linkage_spec.rb +13 -0
- data/spec/integration/path_intake_scenarios_spec.rb +101 -0
- data/spec/integration/path_length_reporting_spec.rb +64 -0
- data/spec/integration/path_scenarios_spec.rb +399 -0
- data/spec/integration/quote_include_isolator_spec.rb +57 -1
- data/spec/integration/report_build_warnings_log_spec.rb +1 -1
- data/spec/integration/report_tests_log_factory_spec.rb +1 -1
- data/spec/integration/test_build_parallel_barrier_spec.rb +1 -1
- data/spec/integration/test_executable_manifest_spec.rb +1 -1
- data/spec/integration/test_includes_extractinator_spec.rb +69 -3
- data/spec/integration/test_naming_spec.rb +201 -0
- data/spec/integration/test_source_file_checks_spec.rb +168 -0
- data/spec/integration/tool_executor_spec.rb +1 -1
- data/spec/integration/tool_validator_spec.rb +3 -3
- data/spec/integration/upgrade_docs_spec.rb +84 -0
- data/spec/integration/vendor_copy_transient_io_retry_spec.rb +74 -5
- data/spec/integration/win_long_paths_probe_spec.rb +46 -0
- data/spec/integration/win_path_limit_spec.rb +53 -0
- data/spec/integration/windows_registry_query_tool_spec.rb +41 -0
- data/spec/support/file_tree_helper.rb +88 -0
- data/spec/support/integration/configurator_integration_helper.rb +14 -9
- data/spec/support/integration/dependency_tracker_integration_helper.rb +1 -1
- data/spec/support/integration/partial_files_harness.rb +181 -0
- data/spec/support/integration/partials_generation_integration_helper.rb +239 -143
- data/spec/support/integration/path_scenario_harness.rb +175 -0
- data/spec/support/integration/spec_integration_helper.rb +9 -4
- data/spec/support/integration/test_includes_harness.rb +69 -37
- data/spec/support/integration/tool_executor_integration_helper.rb +14 -2
- data/spec/support/spec_helper.rb +2 -0
- data/spec/support/system/spec_system_helper.rb +7 -6
- data/spec/support/system/system_context.rb +21 -3
- data/spec/support/working_dir_tracking.rb +49 -0
- data/spec/system/build_output_mirroring_spec.rb +2 -2
- data/spec/system/bullseye_deployment_spec.rb +2 -0
- data/spec/system/conditional_mock_includes_spec.rb +1 -1
- data/spec/system/delta_builds_spec.rb +163 -23
- data/spec/system/encoding_stress_spec.rb +4 -4
- data/spec/system/example_wondrous_forest_spec.rb +2 -2
- data/spec/system/gcov_deployment_spec.rb +3 -0
- data/spec/system/header_include_path_validation_spec.rb +4 -4
- data/spec/system/header_search_paths_spec.rb +1083 -0
- data/spec/system/launcher_handoff_spec.rb +82 -0
- data/spec/system/mock_include_folders_spec.rb +212 -0
- data/spec/system/mockable_header_reassembly_spec.rb +184 -0
- data/spec/system/parent_directory_reference_spec.rb +5 -3
- data/spec/system/partials_carry_spec.rb +581 -0
- data/spec/system/partials_delta_builds_spec.rb +280 -0
- data/spec/system/partials_function_pointers_spec.rb +106 -0
- data/spec/system/partials_macro_decorators_spec.rb +127 -0
- data/spec/system/partials_module_disambiguation_spec.rb +125 -0
- data/spec/system/path_handling_probes_spec.rb +196 -0
- data/spec/system/pinned_thread_count_spec.rb +4 -4
- data/spec/system/preprocessing_fallback_conditionals_spec.rb +1 -1
- data/spec/system/preprocessing_parameterized_tests_spec.rb +1 -1
- data/spec/system/rake_release_task_path_disambiguation_spec.rb +6 -6
- data/spec/system/rake_test_task_path_disambiguation_spec.rb +85 -0
- data/spec/system/short_build_paths_spec.rb +87 -0
- data/spec/system/sibling_header_collision_spec.rb +30 -6
- data/spec/system/special_path_characters_spec.rb +86 -0
- data/spec/system/support/bullseye_common_test_cases.rb +42 -0
- data/spec/system/support/common_test_cases.rb +23 -21
- data/spec/system/support/gcov_common_test_cases.rb +37 -9
- data/spec/system/support/gcov_partials_test_cases.rb +48 -0
- data/spec/system/support/sanitize_common_test_cases.rb +2 -2
- data/spec/system/support/valgrind_common_test_cases.rb +12 -12
- data/spec/system/test_build_layout_spec.rb +209 -0
- data/spec/system/test_pipeline_stop_points_spec.rb +4 -4
- data/spec/system/test_runner_system_include_spec.rb +1 -1
- data/spec/system/test_source_file_directive_spec.rb +64 -5
- data/spec/units/bin/actionator_spec.rb +14 -17
- data/spec/units/bin/app_cfg_spec.rb +37 -0
- data/spec/units/bin/cli_handler_spec.rb +282 -6
- data/spec/units/bin/cli_helper_spec.rb +116 -45
- data/spec/units/bin/installation_selector_spec.rb +114 -0
- data/spec/units/bin/launchinator_spec.rb +171 -0
- data/spec/units/bin/path_validator_spec.rb +10 -0
- data/spec/units/bin/versionator_spec.rb +38 -6
- data/spec/units/build_log_writer_spec.rb +57 -0
- data/spec/units/c_extractor/c_extractor_code_text_spec.rb +67 -10
- data/spec/units/c_extractor/c_extractor_declarations_spec.rb +501 -4
- data/spec/units/c_extractor/c_extractor_declarator_spec.rb +245 -0
- data/spec/units/c_extractor/c_extractor_defined_type_spec.rb +45 -0
- data/spec/units/c_extractor/c_extractor_definitions_spec.rb +163 -3
- data/spec/units/c_extractor/c_extractor_functions_spec.rb +462 -21
- data/spec/units/c_extractor/c_extractor_preprocessing_spec.rb +39 -0
- data/spec/units/c_extractor/c_extractor_spec.rb +4 -4
- data/spec/units/c_extractor/c_extractor_types_spec.rb +163 -0
- data/spec/units/c_identifier_spec.rb +35 -0
- data/spec/units/config/build_root_policy_spec.rb +61 -0
- data/spec/units/config/configurator_builder_spec.rb +61 -6
- data/spec/units/config/configurator_paths_validator_spec.rb +292 -0
- data/spec/units/config/configurator_setup_spec.rb +80 -68
- data/spec/units/config/configurator_spec.rb +54 -6
- data/spec/units/config/configurator_validator_spec.rb +1 -172
- data/spec/units/dependencies/dependency_cache_store_spec.rb +98 -2
- data/spec/units/dependencies/dependency_debug_tree_spec.rb +1 -1
- data/spec/units/dependencies/dependency_hasher_spec.rb +42 -1
- data/spec/units/dependencies/dependency_path_normalizer_spec.rb +1 -1
- data/spec/units/dependencies/dependency_tracker_spec.rb +28 -1
- data/spec/units/dependencies/dependinator_spec.rb +17 -2
- data/spec/units/diagnostics/build_step_doctor_spec.rb +170 -0
- data/spec/units/diagnostics/duplicate_symbol_specialist_spec.rb +117 -0
- data/spec/units/diagnostics/header_collision_specialist_spec.rb +267 -0
- data/spec/units/diagnostics/include_depth_specialist_spec.rb +137 -0
- data/spec/units/diagnostics/missing_symbol_specialist_spec.rb +154 -0
- data/spec/units/diagnostics/partial_name_specialist_spec.rb +129 -0
- data/spec/units/diagnostics/toolchain_output_spec.rb +86 -0
- data/spec/units/encodinator_spec.rb +3 -4
- data/spec/units/filename_extension_spec.rb +11 -0
- data/spec/units/filesystem/build_roots_spec.rb +131 -0
- data/spec/units/filesystem/build_subpath_spec.rb +235 -0
- data/spec/units/filesystem/destination_collision_spec.rb +30 -0
- data/spec/units/{file_finder_helper_spec.rb → filesystem/file_finder_helper_spec.rb} +126 -1
- data/spec/units/filesystem/file_finder_spec.rb +845 -0
- data/spec/units/{file_path_collection_utils_spec.rb → filesystem/file_path_collection_utils_spec.rb} +181 -1
- data/spec/units/{file_path_utils_spec.rb → filesystem/file_path_utils_spec.rb} +435 -185
- data/spec/units/filesystem/file_system_wrapper_spec.rb +33 -0
- data/spec/units/filesystem/file_tree_spec.rb +511 -0
- data/spec/units/filesystem/file_tree_windows_spec.rb +78 -0
- data/spec/units/{file_wrapper_spec.rb → filesystem/file_wrapper_spec.rb} +286 -18
- data/spec/units/{path_matcher_spec.rb → filesystem/path_matcher_spec.rb} +48 -1
- data/spec/units/{path_mirror_spec.rb → filesystem/path_mirror_spec.rb} +32 -4
- data/spec/units/filesystem/project_paths_spec.rb +147 -0
- data/spec/units/filesystem/test_build_layout_spec.rb +216 -0
- data/spec/units/filesystem/win_long_paths_spec.rb +204 -0
- data/spec/units/filesystem/win_path_prober_spec.rb +158 -0
- data/spec/units/filesystem/working_dir_spec.rb +71 -0
- data/spec/units/generators/generator_helper_spec.rb +0 -60
- data/spec/units/generators/generator_mocks_spec.rb +13 -0
- data/spec/units/generators/generator_partials_spec.rb +656 -55
- data/spec/units/generators/generator_spec.rb +38 -6
- data/spec/units/generators/generator_test_results_backtrace_spec.rb +50 -46
- data/spec/units/generators/generator_test_results_spec.rb +1 -1
- data/spec/units/generators/generator_test_runner_spec.rb +9 -5
- data/spec/units/generators/partial_source_writer_spec.rb +129 -0
- data/spec/units/handoff_spec.rb +205 -0
- data/spec/units/includes/header_search_spec.rb +406 -0
- data/spec/units/includes/include_factory_spec.rb +23 -6
- data/spec/units/includes/include_pathinator_spec.rb +118 -8
- data/spec/units/includes/include_spec.rb +14 -0
- data/spec/units/includes/includes_spec.rb +176 -19
- data/spec/units/installation_spec.rb +228 -0
- data/spec/units/library_resolver_spec.rb +157 -0
- data/spec/units/loginator_spec.rb +31 -0
- data/spec/units/mock_locator_spec.rb +275 -6
- data/spec/units/partials/include_groups_spec.rb +42 -0
- data/spec/units/partials/partializer_config_spec.rb +32 -0
- data/spec/units/partials/partializer_helper_carry_spec.rb +661 -0
- data/spec/units/partials/partializer_helper_interface_extras_spec.rb +396 -0
- data/spec/units/partials/partializer_helper_spec.rb +529 -277
- data/spec/units/partials/partializer_reconciler_spec.rb +661 -0
- data/spec/units/partials/partializer_spec.rb +1579 -270
- data/spec/units/partials/partializer_utils_spec.rb +269 -232
- data/spec/units/partials/partials_rename_spec.rb +160 -0
- data/spec/units/partials_manager_spec.rb +561 -251
- data/spec/units/plugins/bullseye_spec.rb +49 -2
- data/spec/units/plugins/console_reportinator_spec.rb +73 -26
- data/spec/units/plugins/dependencies_spec.rb +33 -7
- data/spec/units/plugins/dependency_spec_spec.rb +17 -0
- data/spec/units/plugins/gcov_spec.rb +28 -3
- data/spec/units/plugins/gcovr_reportinator_spec.rb +19 -47
- data/spec/units/plugins/gcovr_thresholds_spec.rb +95 -0
- data/spec/units/plugins/module_generator_spec.rb +5 -5
- data/spec/units/plugins/report_build_warnings_log_spec.rb +3 -3
- data/spec/units/plugins/report_log_writer_plugin_spec.rb +10 -1
- data/spec/units/plugins/report_tests_raw_output_log_spec.rb +13 -2
- data/spec/units/plugins/report_tests_teamcity_stdout_spec.rb +77 -3
- data/spec/units/plugins/reportgenerator_reportinator_spec.rb +52 -4
- data/spec/units/plugins/sanitize_records_spec.rb +3 -1
- data/spec/units/plugins/sanitize_spec.rb +1 -1
- data/spec/units/plugins/valgrind_spec.rb +23 -8
- data/spec/units/preprocess/preprocessinator_code_finder_spec.rb +73 -10
- data/spec/units/preprocess/preprocessinator_comment_stripper_spec.rb +1 -1
- data/spec/units/preprocess/preprocessinator_file_assembler_spec.rb +125 -37
- data/spec/units/preprocess/preprocessinator_includes_handler_spec.rb +15 -0
- data/spec/units/preprocess/preprocessinator_reconstructor_spec.rb +197 -0
- data/spec/units/preprocess/preprocessinator_spec.rb +153 -95
- data/spec/units/rake_app/rakefile_component_resolver_spec.rb +21 -0
- data/spec/units/release_build_executor_spec.rb +53 -14
- data/spec/units/release_build_planner_spec.rb +15 -3
- data/spec/units/reportinator_spec.rb +5 -5
- data/spec/units/setupinator_spec.rb +51 -0
- data/spec/units/standin_headerinator_spec.rb +55 -9
- data/spec/units/test_build_executor_spec.rb +842 -166
- data/spec/units/test_build_planner_spec.rb +205 -15
- data/spec/units/test_build_setup_spec.rb +179 -30
- data/spec/units/test_context_extractor_spec.rb +36 -2
- data/spec/units/test_derived_search_paths_spec.rb +259 -0
- data/spec/units/test_file_preprocessinator_spec.rb +17 -1
- data/spec/units/test_includes_extractinator_spec.rb +61 -9
- data/spec/units/test_invoker/objects_wiring_spec.rb +24 -4
- data/spec/units/test_invoker/partial_files_preprocessinator_spec.rb +264 -0
- data/spec/units/test_invoker/test_substitutions_spec.rb +122 -0
- data/spec/units/test_invoker_spec.rb +14 -1
- data/spec/units/test_invoker_types_spec.rb +8 -7
- data/spec/units/test_pipeline_manager_spec.rb +54 -13
- data/spec/units/test_runner_generatinator_spec.rb +93 -1
- data/spec/units/test_search_paths_spec.rb +73 -5
- data/spec/units/test_source_file_directive_resolver_spec.rb +38 -7
- data/spec/units/tools/default_tools_quoting_spec.rb +117 -0
- data/spec/units/tools/shell_quoting_spec.rb +76 -0
- data/spec/units/{tool_executor_helper_spec.rb → tools/tool_executor_helper_spec.rb} +1 -1
- data/spec/units/{tool_executor_spec.rb → tools/tool_executor_spec.rb} +27 -1
- data/spec/units/{tool_validator_spec.rb → tools/tool_validator_spec.rb} +110 -1
- data/spec/units/windows_registry_query_tool_spec.rb +53 -0
- data/spec/units/yaml_wrapper_spec.rb +11 -0
- metadata +265 -36
- data/lib/ceedling/file_finder_helper.rb +0 -127
- data/lib/ceedling/file_path_collection_utils.rb +0 -164
- data/spec/units/file_finder_spec.rb +0 -495
- /data/lib/ceedling/{tool_executor_helper.rb → tools/tool_executor_helper.rb} +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
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 'set'
|
|
9
|
+
|
|
10
|
+
module Partials
|
|
11
|
+
|
|
12
|
+
# A type attribute a macro writes after a type's closing brace, as `PACKED` in
|
|
13
|
+
# `struct pk { … } PACKED;`. The written text reads the macro as a variable the type defines,
|
|
14
|
+
# or as the start of its variables' type. The expansion shows the macro belongs to the type,
|
|
15
|
+
# so the type is given it back and keeps its layout. A macro for a storage class or a
|
|
16
|
+
# qualifier stays with its variable.
|
|
17
|
+
module TypeMacros
|
|
18
|
+
# Gives a type back the macro the written text read as its one variable. The expansion holds
|
|
19
|
+
# no variable of that name, and it defines the tag on its own. A type with no tag, or with
|
|
20
|
+
# more than one variable, is left alone, since its expansion can't be matched. Returns a log
|
|
21
|
+
# entry for each type given its macro.
|
|
22
|
+
def self.rejoin_trailing(c_module, expanded_module)
|
|
23
|
+
misread = _misread( c_module, expanded_module )
|
|
24
|
+
|
|
25
|
+
misread.each { |var| var.defined_type.text = "#{var.defined_type.text.chomp( ';' )} #{var.text}" }
|
|
26
|
+
c_module.remove!( misread )
|
|
27
|
+
return misread.map { |var| _entry( var.text.chomp( ';' ).strip, var ) }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Gives a type back the macro its variable's type starts with, as in
|
|
31
|
+
# `struct pk { … } PACKED inst;`. The twin's type lacks the macro, since its expansion joined
|
|
32
|
+
# the twin's defined type after the closing brace. `ended` holds the types already given
|
|
33
|
+
# their macro, since variables share a type. Returns a log entry when the type takes the
|
|
34
|
+
# macro, or nil.
|
|
35
|
+
def self.rejoin_leading(var, twin, ended)
|
|
36
|
+
macro = _leading_macro( var, twin )
|
|
37
|
+
return nil if macro.nil?
|
|
38
|
+
|
|
39
|
+
var.type = var.type.strip.delete_prefix( macro ).strip
|
|
40
|
+
var.text = var.text.delete_prefix( macro ).lstrip
|
|
41
|
+
return nil unless _end_type( var.defined_type, macro, ended )
|
|
42
|
+
|
|
43
|
+
return _entry( macro, var )
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# A rejoin's log entry, naming the type by its tag, or else by the variable it defines
|
|
47
|
+
def self._entry(macro, var)
|
|
48
|
+
tag = var.defined_type.tag
|
|
49
|
+
return "`#{macro}` (type attribute of #{tag ? "`#{tag}`" : "the type of `#{var.name}`"})"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# The written variables that are macros ending their types
|
|
53
|
+
def self._misread(c_module, expanded_module)
|
|
54
|
+
names = Set.new( expanded_module.variable_declarations.filter_map( &:name ) )
|
|
55
|
+
tags = _standalone_tags( expanded_module )
|
|
56
|
+
sharing = _variables_by_type( c_module )
|
|
57
|
+
|
|
58
|
+
return c_module.variable_declarations.select { |var| _misread?( var, names, tags, sharing ) }
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Whether a written variable is a macro that ends its type. It must be the type's only variable.
|
|
62
|
+
def self._misread?(var, names, tags, sharing)
|
|
63
|
+
tag = var.defined_type&.tag
|
|
64
|
+
return false if tag.nil? or names.include?( var.name ) or !tags.include?( tag )
|
|
65
|
+
|
|
66
|
+
return sharing[var.defined_type] == 1
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# How many variables each type defines, by the type's identity
|
|
70
|
+
def self._variables_by_type(c_module)
|
|
71
|
+
sharing = Hash.new( 0 ).compare_by_identity
|
|
72
|
+
c_module.variable_declarations.each { |var| sharing[var.defined_type] += 1 if var.defined_type }
|
|
73
|
+
return sharing
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# The tags of the types a module defines with a body, apart from any named variable. A
|
|
77
|
+
# forward declaration defines nothing. A declaration with no variable name, as
|
|
78
|
+
# `static struct pk { … } __attribute__((packed));` expands, still defines its type alone.
|
|
79
|
+
def self._standalone_tags(c_module)
|
|
80
|
+
named = c_module.variable_declarations.select( &:name ).filter_map( &:defined_type )
|
|
81
|
+
defined = Set.new.compare_by_identity.merge( named )
|
|
82
|
+
bodied = c_module.aggregate_definitions.select { |type| type.text.include?( '{' ) and !defined.include?( type ) }
|
|
83
|
+
return Set.new( bodied.filter_map( &:tag ) )
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# The start of a written variable's type that its twin's type lacks, or nil
|
|
87
|
+
def self._leading_macro(var, twin)
|
|
88
|
+
return nil unless _expanded_into_type?( var, twin )
|
|
89
|
+
|
|
90
|
+
written = var.type.to_s.strip
|
|
91
|
+
rest = twin.type.to_s.strip
|
|
92
|
+
return nil unless written.end_with?( rest )
|
|
93
|
+
|
|
94
|
+
macro = written.delete_suffix( rest ).strip
|
|
95
|
+
return macro.empty? ? nil : macro
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Whether a macro ahead of the variable expanded into its twin's type. Both must define their
|
|
99
|
+
# type, since only then does the macro follow a closing brace. The twin's type must hold more
|
|
100
|
+
# after its brace than the written one. A macro that adds a decorator, such as `static` or
|
|
101
|
+
# `const`, belongs to the variable.
|
|
102
|
+
def self._expanded_into_type?(var, twin)
|
|
103
|
+
return false if var.defined_type.nil? or twin.defined_type.nil?
|
|
104
|
+
return false unless (twin.decorators - var.decorators).empty?
|
|
105
|
+
|
|
106
|
+
return _extension( twin.defined_type ).length > _extension( var.defined_type ).length
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# What a type's text holds after its closing brace, less any ending ';'
|
|
110
|
+
def self._extension(type)
|
|
111
|
+
return type.text[/\}([^}]*)\z/, 1].to_s.strip.chomp( ';' ).strip
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Writes `macro` after a type's closing brace, ahead of any ';' that ends the statement.
|
|
115
|
+
# Once per type, as `ended` records. Returns whether it wrote.
|
|
116
|
+
def self._end_type(type, macro, ended)
|
|
117
|
+
return false if ended.include?( type )
|
|
118
|
+
|
|
119
|
+
ended << type
|
|
120
|
+
text = type.text.rstrip
|
|
121
|
+
type.text = text.end_with?( ';' ) ? "#{text.chomp( ';' ).rstrip} #{macro};" : "#{text} #{macro}"
|
|
122
|
+
return true
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
end
|
|
@@ -27,12 +27,10 @@ class ReportLogWriterPlugin < Plugin
|
|
|
27
27
|
|
|
28
28
|
private
|
|
29
29
|
|
|
30
|
-
#
|
|
31
|
-
#
|
|
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
|
-
|
|
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
|
|
@@ -4,22 +4,22 @@ Ceedling runs the real C preprocessor to answer questions about a test file or h
|
|
|
4
4
|
|
|
5
5
|
The subsystem answers two questions and produces one artifact:
|
|
6
6
|
|
|
7
|
-
- **What does this file include?** A reconciled, categorized list of a file
|
|
8
|
-
- **What does this file contain once resolved?** The file
|
|
7
|
+
- **What does this file include?** A reconciled, categorized list of a file’s own top-level `#include` directives — each tagged user or system, each rendered as it should appear in generated code.
|
|
8
|
+
- **What does this file contain once resolved?** The file’s text with conditionals resolved and includes followed, either preserving macro directives (for later text extraction) or fully expanded (to see through a macro hiding a signature).
|
|
9
9
|
- **A reconstructed C file** built from that resolved text plus the reconciled include list, ready to compile or to feed a mock/Partial generator.
|
|
10
10
|
|
|
11
11
|
One class is the entry point: `Preprocessinator` (`preprocessinator.rb`). Every other class in this directory does one piece of the job and is named where that piece is described below. Release builds do not use any of this — a release build only needs true dependencies for staleness tracking, handled by a lighter tool.
|
|
12
12
|
|
|
13
13
|
## Where This Fits in a Test Build
|
|
14
14
|
|
|
15
|
-
`Preprocessinator
|
|
15
|
+
`Preprocessinator`’s public methods are the whole interface. The test pipeline calls them from `test_invoker/` build stages; this document explains their mechanics, not the stage order (documented alongside the pipeline).
|
|
16
16
|
|
|
17
17
|
- `preprocess_bare_includes(filepath:, test:, search_paths:, flags:, defines:)` — the bare `#include` list only, for early stand-in generation. Returns `Array<Include>`, or `nil` if the preprocessor failed.
|
|
18
|
-
- `generate_directives_only_output(filepath:, test:, flags:, include_paths:, vendor_paths:, defines:)` — runs the accurate pass, strips its comments, compacts it. Returns the raw output
|
|
19
|
-
- `generate_fallback_expansion_output(filepath:, test:, flags:, include_paths:, vendor_paths:, defines:)` — runs a test file
|
|
20
|
-
- `preprocess_file_includes_common(test:, filepath:, directives_only_filepath:, fallback:, flags:,
|
|
21
|
-
- `preprocess_mockable_header_file(...)`, `
|
|
22
|
-
- `
|
|
18
|
+
- `generate_directives_only_output(filepath:, test:, flags:, include_paths:, vendor_paths:, defines:)` — runs the accurate pass, strips its comments, compacts it. Returns the raw output’s path, or `nil` if the preprocessor failed.
|
|
19
|
+
- `generate_fallback_expansion_output(filepath:, test:, flags:, include_paths:, vendor_paths:, defines:)` — runs a test file’s plain expansion, fallback’s best-effort stand-in for the accurate pass. Returns its path, or `nil` if the preprocessor failed.
|
|
20
|
+
- `preprocess_file_includes_common(test:, filepath:, directives_only_filepath:, fallback:, flags:, vendor_paths:, defines:)` — the full extract-reconcile-cache path for a mockable header or a Partial header/source. Returns the reconciled `Array<Include>`.
|
|
21
|
+
- `preprocess_mockable_header_file(...)`, `preprocess_partial_file(kind:, ...)`, `preprocess_test_file(...)` — each extracts includes (via the method above, except the test file, which already has its list), then rebuilds the file. `kind` is `:header` or `:source`, and the Partial method also gives back the includes.
|
|
22
|
+
- `generate_partial_expansion(filepath:, test:, ...)` — the full-expansion pass for a Partial file, which reconciliation reads. Returns the path of the file’s own expanded lines, or `nil` if the preprocessor failed.
|
|
23
23
|
- `store_includes_list(...)` / `load_includes_list(...)` — the per-file YAML cache of a reconciled list.
|
|
24
24
|
|
|
25
25
|
## Reading a Line Marker
|
|
@@ -38,9 +38,9 @@ Nearly everything below depends on line markers, and a preprocessor told to drop
|
|
|
38
38
|
|
|
39
39
|
## Finding Every Include, Accurately
|
|
40
40
|
|
|
41
|
-
Knowing a file
|
|
41
|
+
Knowing a file’s includes, and whether each is a user or system header, is harder than it sounds. An include-guarded header reached a second time through another path never reappears in the stream. So a single line-marker pass cannot be trusted as a complete top-level list.
|
|
42
42
|
|
|
43
|
-
Ceedling reconciles two things: a **bare list** of what the file depends on (undifferentiated), and an **accurate list** that categorizes each entry user or system but over-reports (it sees deep nesting). `PreprocessinatorIncludesHandler` (`preprocessinator_includes_handler.rb`) runs every pass and hands each pass
|
|
43
|
+
Ceedling reconciles two things: a **bare list** of what the file depends on (undifferentiated), and an **accurate list** that categorizes each entry user or system but over-reports (it sees deep nesting). `PreprocessinatorIncludesHandler` (`preprocessinator_includes_handler.rb`) runs every pass and hands each pass’s raw output to a parser built for it. `Includes.reconcile` (`includes/includes.rb`) then intersects them.
|
|
44
44
|
|
|
45
45
|
The bare list has **three contributors**, unioned and deduplicated by filepath. Each catches what the others structurally cannot.
|
|
46
46
|
|
|
@@ -52,24 +52,24 @@ The bare list has **three contributors**, unioned and deduplicated by filepath.
|
|
|
52
52
|
gcc -E -M -MG -MP -I"build/vendor/ceedling" -D"UNIT_TEST" -DGNU_COMPILER -nostdinc -x c "test_module.c"
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
`-M` (not `-MM`) keeps system headers in the rule, so the later intersection filters them by agreement rather than by the compiler
|
|
55
|
+
`-M` (not `-MM`) keeps system headers in the rule, so the later intersection filters them by agreement rather than by the compiler’s guess. `-MG` treats a missing header as a to-be-generated file instead of an error. `-MP` emits a phony rule per dependency. `-nostdinc` and the vendor-only `-I` keep real project headers off the search path. Output is a make rule, not C:
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
test_module.o: test_module.c unity.h module.h \
|
|
59
59
|
mock_dependency.h
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
`PreprocessinatorBareIncludesExtractor.extract_includes(make_rules)` (`preprocessinator_bare_includes_extractor.rb`) turns each phony `header:` line into a plain `Include`. The handler gates on `MAKE_RULE_MATCHER` first. No rule means the tool itself failed, since errors in the file
|
|
62
|
+
`PreprocessinatorBareIncludesExtractor.extract_includes(make_rules)` (`preprocessinator_bare_includes_extractor.rb`) turns each phony `header:` line into a plain `Include`. The handler gates on `MAKE_RULE_MATCHER` first. No rule means the tool itself failed, since errors in the file’s own code still leave a rule. The handler then logs the tool’s output at obnoxious verbosity and returns `nil`.
|
|
63
63
|
|
|
64
|
-
Each caller handles a failure its own way. `preprocess_file_includes_common` treats `nil` as an empty list, so contributor 2
|
|
64
|
+
Each caller handles a failure its own way. `preprocess_file_includes_common` treats `nil` as an empty list, so contributor 2’s text scan stands in. Its caller caches that result as it caches any other, so a header’s degraded list can persist until the header changes. That is a best-effort limit. Stage 4 skips caching a test file’s failed run, so the next run tries again.
|
|
65
65
|
|
|
66
|
-
Restricting search paths is not enough on its own. A preprocessor
|
|
66
|
+
Restricting search paths is not enough on its own. A preprocessor’s quoted-`#include` resolution *always* also checks the directory of the file being processed. A same-directory sibling header gets opened and recursed into regardless. So `extract_bare_includes` stages a sibling-free copy of the file into a fresh temp directory for the duration of one gcc run (`QuoteIncludeIsolator#within`), which removes the copy afterward. The temp directory is minted inside the test’s own root of preprocessed files, `preprocess/files/<test>/_t_/` (`FilePathUtils#form_test_preprocess_files_path`), and is not named after the file — both keep the path short for Windows' legacy `MAX_PATH`. Each call gets its own directory, so concurrent preprocessing of sibling files never cross-contaminates.
|
|
67
67
|
|
|
68
68
|
This pass *can* resolve an `#include` whose target is a macro, because a command-line `-D` is visible even to the isolated copy. It *cannot* see a macro another header defines: a conditional gated on `#if SOMETHING_FROM_ANOTHER_HEADER` evaluates against an undefined macro, resolves the wrong way, and drops a real `#include`.
|
|
69
69
|
|
|
70
70
|
### Bare contributor 2 — the literal text scan (#1223)
|
|
71
71
|
|
|
72
|
-
`PreprocessinatorIncludesHandler#extract_bare_includes_from_text(filepath:)` scans the file
|
|
72
|
+
`PreprocessinatorIncludesHandler#extract_bare_includes_from_text(filepath:)` scans the file’s own text for anything shaped like an `#include "..."` or `#include <...>` line, evaluating no conditionals at all. It closes the gap above: an `#include` behind a guard the isolated pass can't evaluate still has a literal filename in the text.
|
|
73
73
|
|
|
74
74
|
The union is safe. `Includes.reconcile` still keeps an entry only if the accurate pass also reports it. The scan can restore an entry both a literal reading and a real preprocessor agree on; it cannot introduce a spurious one.
|
|
75
75
|
|
|
@@ -88,8 +88,8 @@ It has its own blind spot: an `#include` whose target is a macro has no literal
|
|
|
88
88
|
|
|
89
89
|
The isolated pass can't evaluate the guard; the text scan has no filename. But the accurate `-fdirectives-only` pass *does* open the header and emit an ordinary entering marker for it. The method recovers that resolution:
|
|
90
90
|
|
|
91
|
-
1. `computed_include_source_lines(filepath)` scans the raw source with `ParsingParcels#code_lines_with_num` (comments stripped, backslash continuations folded). It collects the 1-indexed line of every `#include` directive whose argument matches neither `PATTERNS::USER_INCLUDE_DIRECTIVE_FILENAME` nor `PATTERNS::SYSTEM_INCLUDE_DIRECTIVE_FILENAME` — a bare token, i.e. a macro. The line reported is the directive
|
|
92
|
-
2. `PreprocessinatorLineMarkerIncludesExtractor#resolve_computed_includes(preprocessed_filepath:, source_basename:, source_lines:)` walks the line-marker output. It tracks `src_line`, the source line the next non-marker physical line maps to: a `# n "<source basename>" …` marker sets `src_line = n`; each body line of that file increments it. The macro-target directive is *replaced* by the entering marker for the header it pulled in, so it never appears as a body line — `src_line` still names that directive
|
|
91
|
+
1. `computed_include_source_lines(filepath)` scans the raw source with `ParsingParcels#code_lines_with_num` (comments stripped, backslash continuations folded). It collects the 1-indexed line of every `#include` directive whose argument matches neither `PATTERNS::USER_INCLUDE_DIRECTIVE_FILENAME` nor `PATTERNS::SYSTEM_INCLUDE_DIRECTIVE_FILENAME` — a bare token, i.e. a macro. The line reported is the directive’s ENDING physical line (`code_lines_with_num`’s 3rd yielded value), not its first: `-fdirectives-only` attributes a consumed multi-line directive’s own entering marker to the last physical line it spans, not the first, so the two must agree on which line that is. For an ordinary single-line directive the start and end line are the same.
|
|
92
|
+
2. `PreprocessinatorLineMarkerIncludesExtractor#resolve_computed_includes(preprocessed_filepath:, source_basename:, source_lines:)` walks the line-marker output. It tracks `src_line`, the source line the next non-marker physical line maps to: a `# n "<source basename>" …` marker sets `src_line = n`; each body line of that file increments it. The macro-target directive is *replaced* by the entering marker for the header it pulled in, so it never appears as a body line — `src_line` still names that directive’s line when its entering marker (`flag 1`, another file) appears. Body lines and markers of any other file are skipped, so a header’s own nesting can't drift the count. It returns `{ source_line => resolved_path }` for every wanted line that produced an entering marker.
|
|
93
93
|
3. Each resolved path becomes a base `Include`.
|
|
94
94
|
|
|
95
95
|
`preprocess_file_includes_common` unions the result into `bare` right after contributor 2, guarded `unless fallback` — a header in fallback has no line-marker stream to read. `Includes.reconcile` is untouched: the computed include is now corroborated in `bare` like a literal one and still gated by the accurate list.
|
|
@@ -117,14 +117,14 @@ void module_calculate(int value);
|
|
|
117
117
|
|
|
118
118
|
`PreprocessinatorIncludesHandler` reads this twice:
|
|
119
119
|
|
|
120
|
-
- `extract_user_includes_preprocess(name:, filepath:, preprocessed_filepath:)` → `PreprocessinatorLineMarkerIncludesExtractor#extract_includes_from_file(path, USER, test: name)`. No depth limit — a user header matters however deeply it nests. `test:` lets the extractor strip the test
|
|
120
|
+
- `extract_user_includes_preprocess(name:, filepath:, preprocessed_filepath:)` → `PreprocessinatorLineMarkerIncludesExtractor#extract_includes_from_file(path, USER, test: name)`. No depth limit — a user header matters however deeply it nests. `test:` lets the extractor strip the test’s own mock subdirectory off a resolved mock path.
|
|
121
121
|
- `extract_system_includes_preprocess(...)` → `extract_includes_from_file(path, SYSTEM, SYSTEM_INCLUDE_MAX_DEPTH)`. `SYSTEM_INCLUDE_MAX_DEPTH` is a literal `5` in the handler — a practical ceiling, since system headers nest deeply through their own wrappers and anything past a handful of levels is noise, not a project dependency. There is no config key for it.
|
|
122
122
|
|
|
123
|
-
`generate_directives_only_output` also strips the raw output
|
|
123
|
+
`generate_directives_only_output` also strips the raw output’s comments in place (`PreprocessinatorCommentStripper`) and writes a second, marker-free compacted file (`PreprocessinatorReconstructor`). Line-to-line correspondence with the source survives comment stripping, which is what the computed-include walk depends on.
|
|
124
124
|
|
|
125
125
|
### Fallback — a plain expansion in its place
|
|
126
126
|
|
|
127
|
-
Without `-fdirectives-only`, a test file
|
|
127
|
+
Without `-fdirectives-only`, a test file’s accurate list comes from a plain expansion, as a best effort with no guarantees. `generate_fallback_expansion_output` runs `tools_test_file_full_preprocessor` with the test’s full search paths, stand-ins included:
|
|
128
128
|
|
|
129
129
|
```
|
|
130
130
|
gcc -E -I"build/test/mocks/test_module" -I"src" -D"UNIT_TEST" -x c "test_module.c" -o "fallback_expansion/test_module.c"
|
|
@@ -132,36 +132,39 @@ gcc -E -I"build/test/mocks/test_module" -I"src" -D"UNIT_TEST" -x c "test_module.
|
|
|
132
132
|
|
|
133
133
|
A plain expansion keeps no macro directives and no comments. Its line markers still record every file the preprocessor entered. `extract_user_includes_preprocess` and `extract_system_includes_preprocess` read it exactly as they read directives-only output. Contributor 3 reads it too. The expansion drops runs of lines it has no use for, but it ends each gap with a `# n` marker for the file, so `src_line` resets. Nothing strips or compacts the expansion, because nothing reads its code.
|
|
134
134
|
|
|
135
|
-
Two constraints shape where it lives. The output keeps the test file
|
|
135
|
+
Two constraints shape where it lives. The output keeps the test file’s basename, since `extract_includes` finds the start of the test file’s own lines by matching that basename against a `# 1` marker. It also sits apart from `full_expansion/`, which stage 11 writes with real mocks in place of stand-ins. Only stage 4’s test-file pass uses this mode. Headers and Partials in fallback still use the text scan described under [Caching and the Fallback Path](#caching-and-the-fallback-path).
|
|
136
136
|
|
|
137
137
|
### Reconciliation
|
|
138
138
|
|
|
139
139
|
`Includes.reconcile(bare:, user:, system:, test_filepath:, &on_ambiguous)`:
|
|
140
140
|
|
|
141
141
|
- `bare` must be plain `Include` objects only. `user` / `system` are `UserInclude` / `SystemInclude` (or `MockInclude`).
|
|
142
|
-
- A **user** entry survives if some bare entry corresponds to it *by path* — segment-wise, honoring whichever side carries less path. Two same-basename project files in different directories stay distinct.
|
|
143
|
-
- A **system** entry survives if some bare entry shares its *filename* (system headers legitimately reach one basename through several real files). The kept entry is rebuilt with `include_path:` recovered from `bare` via `best_bare_match`, so `<sys/stat.h>` renders as written, not collapsed to `<stat.h>`.
|
|
144
|
-
- A matched user entry renders filename-only by default
|
|
145
|
-
- `test_filepath`
|
|
142
|
+
- A **user** entry survives if some bare entry corresponds to it *by path* — segment-wise, honoring whichever side carries less path. Two same-basename project files in different directories stay distinct. Each bare entry pairs with one candidate (`pair_candidates`). The entry with the fewest candidates claims first, so a pathless `config.h` never takes the header `app/config.h` names. Ties go in bare order, which puts GCC’s entry ahead of the text scan’s. A computed `#include`’s line-marker path claims after every written text, and a repeat of an earlier entry’s path, as `drivers/foo.h` and `./drivers/foo.h` are, claims nothing. An entry takes the candidate its whole path names if that is unclaimed, else its first unclaimed candidate in `user`’s order (real preprocessor-derived priority). One file a preprocessor names two ways, as `drivers/./foo.h`, counts as one candidate. `on_ambiguous` gets the bare path, the choice, and the candidates no entry took, and isn’t called when no other candidate is left.
|
|
143
|
+
- A **system** entry survives if some bare entry shares its *filename* (system headers legitimately reach one basename through several real files). The kept entry is rebuilt with `include_path:` recovered from `bare` via `best_bare_match`, so `<sys/stat.h>` renders as written, not collapsed to `<stat.h>`. Entries that would render as the same `#include` line keep only the first. GCC’s own `<stdint.h>`, for one, is a wrapper that does `#include_next <stdint.h>`, so the line-marker walk reports the name at two paths. The first is the header the file named.
|
|
144
|
+
- A matched user entry renders filename-only by default. A resolved-fuller-path candidate (`#include "Types.h"` resolving to `src/Types.h`) would not be found through `-Isrc` if rendered verbatim, and a unique basename finds the right file wherever the header's own directory is a search path. A header reached only through a directory below a search path, as `"drivers/foo.h"` is with `-Isrc`, renders filename-only too. The reconciled list records which headers a file includes. A file generated from it includes each one again by a spelling that reaches its header through the test’s search paths (`Include#spelled_by`): a Partial, CMock’s copy of a header under `:treat_inlines: :include`, and the runner. An `#include`’s spelling is the text it names its header by, as [Finding a test’s headers](../test_invoker/PIPELINE.md#finding-a-tests-headers) explains. A header no search path reaches by any spelling is written by its absolute path, which reaches it from wherever the generated file lives. That holds for a header the preprocessor entered, and for the header a text scan's `#include` names beside its file. It is the case for `lib/config.h`, beside `lib/motor.h`, when `config.h` reaches `src/hw/config.h` first. A header in the build root keeps its text instead, since the compiler’s own search paths reach it. When two or more matched user entries in the same reconciliation share a basename — a genuine collision, e.g. `#include "hw/config.h"` and `#include "app/config.h"` in one file — each renders instead with the shortest trailing-path suffix of its own real, resolved `filepath` that’s unique among the colliding group (`disambiguating_user_include_path`), growing past the first directory level only if that’s still ambiguous. This never reaches further than the colliding files' own real containing directories, so it never risks a spelling Ceedling’s own search paths can't find.
|
|
145
|
+
- A matched mock entry takes the text of the first bare entry that names it, anchored by `test_filepath` (`as_written`). CMock and the runner name the mock by it. GCC’s entry comes first. It holds the `#include` as written, less a leading `./`, or a macro’s expansion. The candidate is the mock’s place below its mirror root, from the stand-in pass 2 entered, which can carry folders the `#include` never wrote. A bare entry carrying more path than its candidate is a computed `#include`’s line-marker path, which wrote no text, so the candidate stays.
|
|
146
|
+
- `test_filepath` anchors a bare entry’s own `..` and names the one file an `on_ambiguous` message should point at.
|
|
146
147
|
|
|
147
148
|
`Preprocessinator#reconcile_includes(bare:, user:, system:, test_filepath:, drop_mocked: true)` is the shared merge step. It calls `Includes.reconcile`, logs a `NOTICE` on each ambiguity, and — when `drop_mocked` — runs `Includes.sanitize!` to drop a header whose `cmock_mock_prefix`-named mock is also present. Two call sites use it, each owning its own bare source and caching:
|
|
148
149
|
|
|
149
150
|
- `preprocess_file_includes_common` — mockable headers and Partials. `drop_mocked: true`.
|
|
150
|
-
- `test_invoker/test_includes_reconcilinator.rb`, stage 4
|
|
151
|
+
- `test_invoker/test_includes_reconcilinator.rb`, stage 4’s third pass — the test file itself. `drop_mocked: false`, because a test’s own `#include` of a mock is deliberate. Its bare source is stage 4’s own list with the same text and computed supplements (`supplement_with_text_includes`, `supplement_with_computed_includes`), except when its second pass failed, when it is GCC’s list alone. Its accurate lists come from directives-only output, or in fallback from the plain expansion.
|
|
151
152
|
|
|
152
|
-
The reconciled list is also cleaned of any self-reference (`clean_self_reference`, normalized-path comparison).
|
|
153
|
+
The reconciled list is also cleaned of any self-reference (`clean_self_reference`, normalized-path comparison). `Includes.sanitize!` keeps a pathless entry beside a same-named one with a folder. In a bare, scanned or reconciled list each is an `#include` as written or the header it reached, and the two can name different headers. Only a Partial’s remapped list drops the pathless one (`Includes.drop_shadowed!`), since fallback can hold an `#include` as written beside the header it resolved to.
|
|
153
154
|
|
|
154
155
|
## Expanding a File in Full
|
|
155
156
|
|
|
156
|
-
A separate pass
|
|
157
|
+
A separate pass expands every macro in a Partial file, since a project macro can hide a decorator, a call or a type attribute (`#define PRIVATE static`). Partial reconciliation reads the result (see `partials/README.md`). `Preprocessinator#generate_partial_expansion` runs `tools_test_file_full_preprocessor`:
|
|
157
158
|
|
|
158
159
|
```
|
|
159
160
|
gcc -E -I"src" -D"UNIT_TEST" -x c "test_module.c" -o "out.c"
|
|
160
161
|
```
|
|
161
162
|
|
|
162
|
-
|
|
163
|
+
The pass writes two files. GCC’s raw output stays whole under `full_expansion/`, since its line markers name every header the file entered, and stage 6 or 7 registers those headers as dependencies. The file’s own lines go under `expanded_code/` as plain code, which reconciliation parses. A nonzero exit doesn’t raise. Both files are removed and the method returns `nil`, so an earlier run’s expansion never passes for this one’s, and reconciliation has nothing to read.
|
|
163
164
|
|
|
164
|
-
|
|
165
|
+
Every stale Partial file gets this pass, with no attempt to detect a hiding macro first. A sound check would fire on nearly every module, since even `bool` from `stdbool.h` is a macro.
|
|
166
|
+
|
|
167
|
+
All three runs share one private runner, `run_preprocessor(tool, filepath, output, flags:, include_paths:, vendor_paths:, defines:)`. It builds the command for whichever tool the caller names, with the file’s own search paths ahead of vendor paths, and sets `boom: false`. Each caller then handles a failure its own way.
|
|
165
168
|
|
|
166
169
|
Directives-only output still shows `PRIVATE void module_calculate(void)`; full-expansion output shows `static void module_calculate(void)` with the `#define` gone.
|
|
167
170
|
|
|
@@ -178,7 +181,14 @@ some_text_we_do_want();
|
|
|
178
181
|
ignored_text();
|
|
179
182
|
```
|
|
180
183
|
|
|
181
|
-
leaves only `some_text_we_do_want();`. `PreprocessinatorFileAssembler` then places the file
|
|
184
|
+
leaves only `some_text_we_do_want();`. `PreprocessinatorFileAssembler` then places the file’s own original `#include` directives — drawn from the reconciled list — back at the top, ahead of the recovered body.
|
|
185
|
+
|
|
186
|
+
The walk counts the file’s lines between its markers. In full expansion, one source line can come out as several physical lines: GCC re-marks the same line number to continue it, as with a dangling `;` after a system typedef. A line whose count equals the count at the file’s last marker is therefore joined onto the line before it. Two rules keep that join from gluing lines that were never one:
|
|
187
|
+
|
|
188
|
+
- A directive is never joined to a neighbor. The preprocessor writes each directive it keeps on a line of its own, such as a mid-line `_Pragma()` between two markers for the same source line.
|
|
189
|
+
- Directives-only output expands no macros and never wraps a line, so its readers pass `rejoin: false` and nothing is joined.
|
|
190
|
+
|
|
191
|
+
A reassembled header reuses the original header’s include guard when it has one (`extract_include_guard`), so the copy and the original are recognized as the same header wherever both are reachable. The guard is the first `#ifndef X` followed by `#define X`, searched for in the header’s code alone, comments and blank lines left out, within its first 2,048 bytes (`INCLUDE_GUARD_SCAN_BYTES`). A long license comment ahead of the guard doesn't hide it, and the limit keeps a `#ifndef`/`#define` default deep in a `#pragma once` header from passing for one. A header with no guard gets a generated one.
|
|
182
192
|
|
|
183
193
|
## Comments and Why They Go First
|
|
184
194
|
|
|
@@ -186,7 +196,7 @@ Later steps read macro definitions and marker macros straight out of preprocesso
|
|
|
186
196
|
|
|
187
197
|
## Finding Where a Snippet Came From
|
|
188
198
|
|
|
189
|
-
`PreprocessinatorCodeFinder` (`preprocessinator_code_finder.rb`) traces a piece of already-preprocessed text back to its original
|
|
199
|
+
`PreprocessinatorCodeFinder` (`preprocessinator_code_finder.rb`) traces a piece of already-preprocessed text back to its original line. It finds the last line marker ending at or before the text and counts the newlines after it. One read of a file serves every piece searched in it. Ceedling’s Partials feature uses this to point a copied-out function at its true source location.
|
|
190
200
|
|
|
191
201
|
## Caching and the Fallback Path
|
|
192
202
|
|
|
@@ -196,4 +206,4 @@ When a real pass is impossible — the toolchain lacks `-fdirectives-only` (olde
|
|
|
196
206
|
|
|
197
207
|
## Executable Specification
|
|
198
208
|
|
|
199
|
-
`spec/integration/includes_extraction_spec.rb` is the executable specification of everything above. Each example lays a small C tree on disk, runs the real Preprocessinator graph against real GCC (no `ceedling` build), and asserts the reconciled, rendered list — across accurate and fallback modes, every guard shape, the mock filter, same-basename collisions, and the computed-include matrix. `spec/integration/test_includes_extractinator_spec.rb` does the same for a test file
|
|
209
|
+
`spec/integration/includes_extraction_spec.rb` is the executable specification of everything above. Each example lays a small C tree on disk, runs the real Preprocessinator graph against real GCC (no `ceedling` build), and asserts the reconciled, rendered list — across accurate and fallback modes, every guard shape, the mock filter, same-basename collisions, and the computed-include matrix. `spec/integration/test_includes_extractinator_spec.rb` does the same for a test file’s stage 4, running each scenario with directives-only output and again in fallback. The unit specs under `spec/units/preprocess/` cover each parser’s branching in isolation.
|