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
|
@@ -6,12 +6,21 @@
|
|
|
6
6
|
# =========================================================================
|
|
7
7
|
|
|
8
8
|
require 'spec_helper'
|
|
9
|
-
require 'ceedling/file_path_utils'
|
|
10
|
-
require 'ceedling/
|
|
9
|
+
require 'ceedling/filesystem/file_path_utils'
|
|
10
|
+
require 'ceedling/filesystem/test_build_layout'
|
|
11
|
+
require 'ceedling/filesystem/file_wrapper'
|
|
11
12
|
require 'ceedling/filename_extension'
|
|
13
|
+
require 'ceedling/filesystem/build_roots'
|
|
14
|
+
require 'yaml'
|
|
12
15
|
|
|
13
16
|
describe FilePathUtils do
|
|
14
17
|
|
|
18
|
+
# A FilePathUtils with a real TestBuildLayout of the same collaborators
|
|
19
|
+
def path_utils(configurator, file_wrapper)
|
|
20
|
+
layout = TestBuildLayout.new( { :configurator => configurator, :file_wrapper => file_wrapper } )
|
|
21
|
+
return described_class.new( { :configurator => configurator, :file_wrapper => file_wrapper, :test_build_layout => layout } )
|
|
22
|
+
end
|
|
23
|
+
|
|
15
24
|
describe '.collapse_to_common_parents' do
|
|
16
25
|
|
|
17
26
|
it 'returns nil unchanged' do
|
|
@@ -37,6 +46,12 @@ describe FilePathUtils do
|
|
|
37
46
|
expect(result).to match_array(['a'])
|
|
38
47
|
end
|
|
39
48
|
|
|
49
|
+
# The path handling audit around GH #1370: `..` holds `../sib` but not `../../far/x`
|
|
50
|
+
it 'keeps a path above the project that no other path holds' do
|
|
51
|
+
result = FilePathUtils.collapse_to_common_parents(['..', '../../far/x', '../sib'])
|
|
52
|
+
expect(result).to match_array(['..', '../../far/x'])
|
|
53
|
+
end
|
|
54
|
+
|
|
40
55
|
it 'handles deeply nested redundant paths' do
|
|
41
56
|
result = FilePathUtils.collapse_to_common_parents(['src', 'src/a/b/c', 'lib'])
|
|
42
57
|
expect(result).to match_array(['src', 'lib'])
|
|
@@ -78,6 +93,11 @@ describe FilePathUtils do
|
|
|
78
93
|
expect( FilePathUtils.standardize_in_place( 'foo/bar/baz' ) ).to eq( 'foo/bar/baz' )
|
|
79
94
|
end
|
|
80
95
|
|
|
96
|
+
# GH #1370 audit (G21)
|
|
97
|
+
it 'reads `~` as the home directory' do
|
|
98
|
+
expect( FilePathUtils.standardize_in_place( +'~/inc' ) ).to eq( File.join( Dir.home, 'inc' ) )
|
|
99
|
+
end
|
|
100
|
+
|
|
81
101
|
it 'returns nil unchanged for a nil argument' do
|
|
82
102
|
expect( FilePathUtils.standardize_in_place( nil ) ).to be_nil
|
|
83
103
|
end
|
|
@@ -303,10 +323,7 @@ describe FilePathUtils do
|
|
|
303
323
|
@configurator = double('configurator')
|
|
304
324
|
@file_wrapper = double('file_wrapper')
|
|
305
325
|
allow(@file_wrapper).to receive(:check_path_length)
|
|
306
|
-
@fpu =
|
|
307
|
-
:configurator => @configurator,
|
|
308
|
-
:file_wrapper => @file_wrapper
|
|
309
|
-
})
|
|
326
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
310
327
|
|
|
311
328
|
# TEST_RUNNER_FILE_SUFFIX is a global constant created at runtime by
|
|
312
329
|
# ConfiguratorBuilder from the project config. Set it for these tests.
|
|
@@ -351,10 +368,7 @@ describe FilePathUtils do
|
|
|
351
368
|
@configurator = double('configurator')
|
|
352
369
|
@file_wrapper = double('file_wrapper')
|
|
353
370
|
allow(@file_wrapper).to receive(:check_path_length)
|
|
354
|
-
@fpu =
|
|
355
|
-
:configurator => @configurator,
|
|
356
|
-
:file_wrapper => @file_wrapper
|
|
357
|
-
})
|
|
371
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
358
372
|
|
|
359
373
|
allow(@configurator).to receive(:project_test_runners_path).and_return('build/test/runners')
|
|
360
374
|
allow(@configurator).to receive(:test_runner_file_suffix).and_return('_runner')
|
|
@@ -365,25 +379,25 @@ describe FilePathUtils do
|
|
|
365
379
|
.to eq('build/test/runners/test_foo_runner.c')
|
|
366
380
|
end
|
|
367
381
|
|
|
368
|
-
it 'forms a
|
|
369
|
-
expect( @fpu.form_runner_filepath_from_test('
|
|
382
|
+
it 'forms a runner filepath in the runners directory itself for a test at the project root' do
|
|
383
|
+
expect( @fpu.form_runner_filepath_from_test('test_foo.c', name: 'test_foo') )
|
|
370
384
|
.to eq('build/test/runners/test_foo_runner.c')
|
|
371
385
|
end
|
|
372
386
|
|
|
373
|
-
it '
|
|
374
|
-
expect( @fpu.form_runner_filepath_from_test('test/unit/test_foo.c', name: 'unit/test_foo') )
|
|
375
|
-
.to eq('build/test/runners/unit/test_foo_runner.c')
|
|
387
|
+
it 'places the runner beneath the directories of the test\'s name, distinguishing same-named tests' do
|
|
388
|
+
expect( @fpu.form_runner_filepath_from_test('test/unit/test_foo.c', name: 'test/unit/test_foo') )
|
|
389
|
+
.to eq('build/test/runners/test/unit/test_foo_runner.c')
|
|
376
390
|
|
|
377
|
-
expect( @fpu.form_runner_filepath_from_test('test/integration/test_foo.c', name: 'integration/test_foo') )
|
|
378
|
-
.to eq('build/test/runners/integration/test_foo_runner.c')
|
|
391
|
+
expect( @fpu.form_runner_filepath_from_test('test/integration/test_foo.c', name: 'test/integration/test_foo') )
|
|
392
|
+
.to eq('build/test/runners/test/integration/test_foo_runner.c')
|
|
379
393
|
end
|
|
380
394
|
|
|
381
|
-
it 'forms
|
|
395
|
+
it 'forms the runners directory itself for a test at the project root' do
|
|
382
396
|
expect( @fpu.form_test_runners_path('test_foo') ).to eq('build/test/runners')
|
|
383
397
|
end
|
|
384
398
|
|
|
385
|
-
it 'forms the runner directory
|
|
386
|
-
expect( @fpu.form_test_runners_path('unit/test_foo') ).to eq('build/test/runners/unit')
|
|
399
|
+
it 'forms the runner directory beneath the directories of the test\'s name' do
|
|
400
|
+
expect( @fpu.form_test_runners_path('test/unit/test_foo') ).to eq('build/test/runners/test/unit')
|
|
387
401
|
end
|
|
388
402
|
end
|
|
389
403
|
|
|
@@ -392,10 +406,7 @@ describe FilePathUtils do
|
|
|
392
406
|
@configurator = double('configurator')
|
|
393
407
|
@file_wrapper = double('file_wrapper')
|
|
394
408
|
allow(@file_wrapper).to receive(:check_path_length)
|
|
395
|
-
@fpu =
|
|
396
|
-
:configurator => @configurator,
|
|
397
|
-
:file_wrapper => @file_wrapper
|
|
398
|
-
})
|
|
409
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
399
410
|
|
|
400
411
|
allow(@configurator).to receive(:project_release_build_output_path).and_return('build/release/out')
|
|
401
412
|
allow(@configurator).to receive(:project_release_dependencies_path).and_return('build/release/dependencies')
|
|
@@ -424,24 +435,22 @@ describe FilePathUtils do
|
|
|
424
435
|
@configurator = double('configurator')
|
|
425
436
|
@file_wrapper = double('file_wrapper')
|
|
426
437
|
allow(@file_wrapper).to receive(:check_path_length)
|
|
427
|
-
@fpu =
|
|
428
|
-
:configurator => @configurator,
|
|
429
|
-
:file_wrapper => @file_wrapper
|
|
430
|
-
})
|
|
438
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
431
439
|
|
|
432
440
|
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
441
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [] )
|
|
433
442
|
allow(@configurator).to receive(:extension_dependencies).and_return( FilenameExtension.new('.d') )
|
|
434
443
|
allow(@configurator).to receive(:extension_list).and_return( FilenameExtension.new('.lst') )
|
|
435
444
|
end
|
|
436
445
|
|
|
437
446
|
it 'mirrors a dependencies filepath the same way as the object it accompanies, distinguishing same-named modules under test' do
|
|
438
|
-
expect( @fpu.form_test_dependencies_filepath('build/test/out/TestFoo/calculators/AdcCalc.o', name: 'TestFoo', context: :test) )
|
|
439
|
-
.to eq('build/test/dependencies/TestFoo/calculators/AdcCalc.d')
|
|
447
|
+
expect( @fpu.form_test_dependencies_filepath('build/test/out/TestFoo/_t_/calculators/AdcCalc.o', name: 'TestFoo', context: :test) )
|
|
448
|
+
.to eq('build/test/dependencies/TestFoo/_t_/calculators/AdcCalc.d')
|
|
440
449
|
end
|
|
441
450
|
|
|
442
451
|
it 'forms a flat dependencies filepath for a flat object' do
|
|
443
|
-
expect( @fpu.form_test_dependencies_filepath('build/test/out/TestFoo/AdcCalc.o', name: 'TestFoo', context: :test) )
|
|
444
|
-
.to eq('build/test/dependencies/TestFoo/AdcCalc.d')
|
|
452
|
+
expect( @fpu.form_test_dependencies_filepath('build/test/out/TestFoo/_t_/AdcCalc.o', name: 'TestFoo', context: :test) )
|
|
453
|
+
.to eq('build/test/dependencies/TestFoo/_t_/AdcCalc.d')
|
|
445
454
|
end
|
|
446
455
|
|
|
447
456
|
it 'forms a flat dependencies filepath when no test identity is given' do
|
|
@@ -449,9 +458,56 @@ describe FilePathUtils do
|
|
|
449
458
|
.to eq('build/gcov/dependencies/AdcCalc.d')
|
|
450
459
|
end
|
|
451
460
|
|
|
461
|
+
# A context's own objects, outside any test, are placed by their sources' paths too
|
|
462
|
+
it 'follows a context\'s own object below its output root when no test identity is given' do
|
|
463
|
+
expect( @fpu.form_test_dependencies_filepath('build/gcov/out/src/a/util.o', context: :gcov) )
|
|
464
|
+
.to eq('build/gcov/dependencies/src/a/util.d')
|
|
465
|
+
end
|
|
466
|
+
|
|
452
467
|
it 'forms the list filepath directly alongside the object, wherever it was mirrored to' do
|
|
453
|
-
expect( @fpu.form_test_build_list_filepath('build/test/out/TestFoo/calculators/AdcCalc.o') )
|
|
454
|
-
.to eq('build/test/out/TestFoo/calculators/AdcCalc.lst')
|
|
468
|
+
expect( @fpu.form_test_build_list_filepath('build/test/out/TestFoo/_t_/calculators/AdcCalc.o') )
|
|
469
|
+
.to eq('build/test/out/TestFoo/_t_/calculators/AdcCalc.lst')
|
|
470
|
+
end
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
describe '#form_test_object_filepath' do
|
|
474
|
+
before(:each) do
|
|
475
|
+
@configurator = double('configurator')
|
|
476
|
+
@file_wrapper = double('file_wrapper')
|
|
477
|
+
allow(@file_wrapper).to receive(:check_path_length)
|
|
478
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
479
|
+
|
|
480
|
+
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
481
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [] )
|
|
482
|
+
allow(@configurator).to receive(:extension_object).and_return( FilenameExtension.new('.o') )
|
|
483
|
+
allow(@configurator).to receive(:project_use_partials).and_return( true )
|
|
484
|
+
allow(@configurator).to receive(:project_use_mocks).and_return( true )
|
|
485
|
+
allow(@configurator).to receive(:project_test_partials_path).and_return('build/test/partials')
|
|
486
|
+
allow(@configurator).to receive(:cmock_mock_path).and_return('build/test/mocks')
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
it 'places a test\'s object where its build does, by the source\'s path from the project root' do
|
|
490
|
+
expect( @fpu.form_test_object_filepath('src/a/util.c', name: 'test/test_util', context: :gcov) )
|
|
491
|
+
.to eq('build/gcov/out/test/test_util/_t_/src/a/util.o')
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
# Untested sources compile outside any test, so same-named ones keep apart only by path
|
|
495
|
+
it 'places a context\'s own objects apart, by their sources\' paths, when no test is named' do
|
|
496
|
+
expect( @fpu.form_test_object_filepath('src/a/util.c', context: :gcov) ).to eq('build/gcov/out/src/a/util.o')
|
|
497
|
+
expect( @fpu.form_test_object_filepath('src/b/util.c', context: :gcov) ).to eq('build/gcov/out/src/b/util.o')
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
it 'places a test\'s generated Partial below its own subdirectory, as its build does' do
|
|
501
|
+
expect(
|
|
502
|
+
@fpu.form_test_object_filepath('build/test/partials/test/test_util/_t_/drv/ceedling_partial_util_impl.c', name: 'test/test_util', context: :gcov)
|
|
503
|
+
).to eq('build/gcov/out/test/test_util/_t_/drv/ceedling_partial_util_impl.o')
|
|
504
|
+
end
|
|
505
|
+
|
|
506
|
+
# A test context's own objects sit below the base every test's root shares
|
|
507
|
+
it 'places a source in a directory named `_t_` apart from any test root, in or outside a test' do
|
|
508
|
+
expect( @fpu.form_test_object_filepath('src/_t_/foo.c', name: 'test/test_c', context: :test) )
|
|
509
|
+
.to eq('build/test/out/test/test_c/_t_/src/__t_/foo.o')
|
|
510
|
+
expect( @fpu.form_test_object_filepath('src/_t_/foo.c', context: :gcov) ).to eq('build/gcov/out/src/__t_/foo.o')
|
|
455
511
|
end
|
|
456
512
|
end
|
|
457
513
|
|
|
@@ -460,27 +516,24 @@ describe FilePathUtils do
|
|
|
460
516
|
@configurator = double('configurator')
|
|
461
517
|
@file_wrapper = double('file_wrapper')
|
|
462
518
|
allow(@file_wrapper).to receive(:check_path_length)
|
|
463
|
-
@fpu =
|
|
464
|
-
:configurator => @configurator,
|
|
465
|
-
:file_wrapper => @file_wrapper
|
|
466
|
-
})
|
|
519
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
467
520
|
|
|
468
521
|
allow(@configurator).to receive(:project_test_preprocess_build_directives_path).and_return('build/test/preprocess/build_directives')
|
|
469
522
|
end
|
|
470
523
|
|
|
471
524
|
it 'forms a per-test build directives cache directory path' do
|
|
472
525
|
expect( @fpu.form_test_preprocess_build_directives_path('TestFoo') )
|
|
473
|
-
.to eq('build/test/preprocess/build_directives/TestFoo')
|
|
526
|
+
.to eq('build/test/preprocess/build_directives/TestFoo/_t_')
|
|
474
527
|
end
|
|
475
528
|
|
|
476
529
|
it 'forms a build directives cache filepath using the fixed internal .yml extension' do
|
|
477
530
|
expect( @fpu.form_test_build_directives_cache_filepath('test/TestFoo.c', 'TestFoo') )
|
|
478
|
-
.to eq('build/test/preprocess/build_directives/TestFoo/TestFoo.c.yml')
|
|
531
|
+
.to eq('build/test/preprocess/build_directives/TestFoo/_t_/TestFoo.c.yml')
|
|
479
532
|
end
|
|
480
533
|
|
|
481
534
|
it 'forms a distinct source files cache filepath alongside the build directives cache' do
|
|
482
535
|
expect( @fpu.form_preprocessed_source_files_cache_filepath('test/TestFoo.c', 'TestFoo') )
|
|
483
|
-
.to eq('build/test/preprocess/build_directives/TestFoo/TestFoo.c_source_files.yml')
|
|
536
|
+
.to eq('build/test/preprocess/build_directives/TestFoo/_t_/TestFoo.c_source_files.yml')
|
|
484
537
|
end
|
|
485
538
|
end
|
|
486
539
|
|
|
@@ -491,25 +544,38 @@ describe FilePathUtils do
|
|
|
491
544
|
:loginator => double('loginator').as_null_object,
|
|
492
545
|
:verbosinator => double('verbosinator').as_null_object
|
|
493
546
|
})
|
|
494
|
-
@fpu =
|
|
495
|
-
:configurator => @configurator,
|
|
496
|
-
:file_wrapper => @file_wrapper
|
|
497
|
-
})
|
|
547
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
498
548
|
|
|
499
549
|
allow(@configurator).to receive(:project_release_build_output_path).and_return('build/release/out')
|
|
550
|
+
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
551
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [] )
|
|
500
552
|
allow(@configurator).to receive(:extension_object).and_return( FilenameExtension.new('.o') )
|
|
501
|
-
allow(@configurator).to receive(:paths_source).and_return( ['drivers'] )
|
|
502
553
|
end
|
|
503
554
|
|
|
504
|
-
it '
|
|
505
|
-
objects = @fpu.form_release_build_objects_filelist( ['drivers/foo/bar.c', 'drivers/baz/bar.c'] )
|
|
506
|
-
expect( objects ).to
|
|
507
|
-
expect( objects ).to include('build/release/out/baz/bar.o')
|
|
555
|
+
it 'places each object by its source\'s path from the project root, distinguishing same-named sources' do
|
|
556
|
+
objects = @fpu.form_release_build_objects_filelist( ['drivers/foo/bar.c', 'drivers/baz/bar.c', 'lib/bar.c'] )
|
|
557
|
+
expect( objects ).to eq(['build/release/out/drivers/foo/bar.o', 'build/release/out/drivers/baz/bar.o', 'build/release/out/lib/bar.o'])
|
|
508
558
|
end
|
|
509
559
|
|
|
510
|
-
it '
|
|
511
|
-
objects = @fpu.form_release_build_objects_filelist( ['
|
|
512
|
-
expect( objects ).to eq(['build/release/out/
|
|
560
|
+
it 'places a source above the project root below the output root' do
|
|
561
|
+
objects = @fpu.form_release_build_objects_filelist( ['../shared/src/crc.c'] )
|
|
562
|
+
expect( objects ).to eq(['build/release/out/_up_/shared/src/crc.o'])
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
it 'leaves a source below the build root flat' do
|
|
566
|
+
objects = @fpu.form_release_build_objects_filelist( ['build/vendor/c_exception/lib/CException.c'] )
|
|
567
|
+
expect( objects ).to eq(['build/release/out/CException.o'])
|
|
568
|
+
end
|
|
569
|
+
|
|
570
|
+
it 'refuses two sources that would build to one object, naming both' do
|
|
571
|
+
expect { @fpu.form_release_build_objects_filelist( ['build/vendor/c_exception/lib/CException.c', 'CException.c'] ) }
|
|
572
|
+
.to raise_error( CeedlingException, /`build\/vendor\/c_exception\/lib\/CException.c` and `CException.c`.*`build\/release\/out\/CException.o`/ )
|
|
573
|
+
end
|
|
574
|
+
|
|
575
|
+
# A release build has no per-test directories, so nothing in its paths is reserved for them
|
|
576
|
+
it 'places a source in a directory named `_t_` at its own path' do
|
|
577
|
+
objects = @fpu.form_release_build_objects_filelist( ['src/_t_/foo.c', 'src/__t_/bar.c'] )
|
|
578
|
+
expect( objects ).to eq(['build/release/out/src/_t_/foo.o', 'build/release/out/src/__t_/bar.o'])
|
|
513
579
|
end
|
|
514
580
|
end
|
|
515
581
|
|
|
@@ -520,37 +586,31 @@ describe FilePathUtils do
|
|
|
520
586
|
:loginator => double('loginator').as_null_object,
|
|
521
587
|
:verbosinator => double('verbosinator').as_null_object
|
|
522
588
|
})
|
|
523
|
-
@fpu =
|
|
524
|
-
:configurator => @configurator,
|
|
525
|
-
:file_wrapper => @file_wrapper
|
|
526
|
-
})
|
|
589
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
527
590
|
|
|
528
591
|
allow(@configurator).to receive(:project_release_dependencies_path).and_return('build/release/dependencies')
|
|
592
|
+
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
593
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [] )
|
|
529
594
|
allow(@configurator).to receive(:extension_dependencies).and_return( FilenameExtension.new('.d') )
|
|
530
|
-
allow(@configurator).to receive(:paths_source).and_return( ['drivers'] )
|
|
531
595
|
end
|
|
532
596
|
|
|
533
|
-
it '
|
|
597
|
+
it 'places each dependency file the same way as its corresponding object' do
|
|
534
598
|
deps = @fpu.form_release_dependencies_filelist( ['drivers/foo/bar.c', 'drivers/baz/bar.c'] )
|
|
535
|
-
expect( deps ).to
|
|
536
|
-
|
|
599
|
+
expect( deps ).to eq(['build/release/dependencies/drivers/foo/bar.d', 'build/release/dependencies/drivers/baz/bar.d'])
|
|
600
|
+
end
|
|
601
|
+
|
|
602
|
+
it 'places the dependency file of a source in a directory named `_t_` at its own path' do
|
|
603
|
+
expect( @fpu.form_release_dependencies_filelist( ['src/_t_/foo.c'] ) ).to eq(['build/release/dependencies/src/_t_/foo.d'])
|
|
537
604
|
end
|
|
538
605
|
end
|
|
539
606
|
|
|
540
|
-
# Every preprocessed artifact for a test lands below that test's own subdirectory.
|
|
541
|
-
# That alone kept artifacts apart while a test had at most one source of any given
|
|
542
|
-
# basename. Two same-basename sources in one test overwrite each other, so the
|
|
543
|
-
# source's own namespace below its configured root is mirrored as well.
|
|
544
607
|
# A mock's generated files sit below its test's mock root, in the subdirectory mirroring
|
|
545
608
|
# whatever it mocks. Two places need that directory -- the stage that compiles the mock
|
|
546
609
|
# and the stage that generates it -- and they must agree, or a mock is compiled from a
|
|
547
610
|
# path nothing ever wrote.
|
|
548
611
|
describe '#form_mock_output_path' do
|
|
549
612
|
before(:each) do
|
|
550
|
-
@fpu =
|
|
551
|
-
:configurator => double('configurator'),
|
|
552
|
-
:file_wrapper => double('file_wrapper')
|
|
553
|
-
})
|
|
613
|
+
@fpu = path_utils( double('configurator'), double('file_wrapper') )
|
|
554
614
|
end
|
|
555
615
|
|
|
556
616
|
it 'joins a mock root and the subdirectory its content mirrors' do
|
|
@@ -573,53 +633,43 @@ describe FilePathUtils do
|
|
|
573
633
|
before(:each) do
|
|
574
634
|
@configurator = double('configurator')
|
|
575
635
|
@file_wrapper = double('file_wrapper')
|
|
576
|
-
@fpu =
|
|
577
|
-
:configurator => @configurator,
|
|
578
|
-
:file_wrapper => @file_wrapper
|
|
579
|
-
})
|
|
636
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
580
637
|
|
|
581
638
|
allow(@configurator).to receive(:project_test_preprocess_files_path).and_return('build/test/preprocess/files')
|
|
582
639
|
allow(@configurator).to receive(:project_test_preprocess_includes_path).and_return('build/test/preprocess/includes')
|
|
583
|
-
allow(@
|
|
584
|
-
allow(@configurator).to receive(:
|
|
585
|
-
allow(@configurator).to receive(:
|
|
586
|
-
allow(@configurator).to receive(:paths_test).and_return( ['test/**'] )
|
|
640
|
+
allow(@file_wrapper).to receive(:check_path_length)
|
|
641
|
+
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
642
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [] )
|
|
587
643
|
allow(@configurator).to receive(:project_use_partials).and_return( true )
|
|
588
644
|
allow(@configurator).to receive(:project_use_mocks).and_return( true )
|
|
589
645
|
allow(@configurator).to receive(:project_test_partials_path).and_return('build/test/partials')
|
|
590
646
|
allow(@configurator).to receive(:cmock_mock_path).and_return('build/test/mocks')
|
|
591
647
|
end
|
|
592
648
|
|
|
593
|
-
#
|
|
594
|
-
#
|
|
595
|
-
it '
|
|
596
|
-
expect( @fpu.form_preprocessed_file_filepath('src/foo.c', 'test_foo') )
|
|
597
|
-
.to eq('build/test/preprocess/files/test_foo/foo.c')
|
|
598
|
-
expect( @fpu.form_preprocessed_file_full_expansion_filepath('src/foo.c', 'test_foo') )
|
|
599
|
-
.to eq('build/test/preprocess/files/test_foo/full_expansion/foo.c')
|
|
600
|
-
expect( @fpu.form_preprocessed_file_raw_directives_only_filepath('src/foo.c', 'test_foo') )
|
|
601
|
-
.to eq('build/test/preprocess/files/test_foo/directives_only/raw/foo.c')
|
|
602
|
-
expect( @fpu.form_preprocessed_file_compacted_directives_only_filepath('src/foo.c', 'test_foo') )
|
|
603
|
-
.to eq('build/test/preprocess/files/test_foo/directives_only/foo.c')
|
|
604
|
-
expect( @fpu.form_preprocessed_file_fallback_expansion_filepath('src/foo.c', 'test_foo') )
|
|
605
|
-
.to eq('build/test/preprocess/files/test_foo/fallback_expansion/foo.c')
|
|
606
|
-
expect( @fpu.form_preprocessed_includes_list_filepath('src/foo.c', 'test_foo') )
|
|
607
|
-
.to eq('build/test/preprocess/includes/test_foo/foo.c.yml')
|
|
608
|
-
end
|
|
609
|
-
|
|
610
|
-
it 'mirrors a nested source below the test subdirectory' do
|
|
649
|
+
# Each artifact of a test sits below the test's own subdirectory, at its file's path
|
|
650
|
+
# from the project root, so two same-named files in one test never share one
|
|
651
|
+
it 'places a file by its path from the project root below the test subdirectory' do
|
|
611
652
|
expect( @fpu.form_preprocessed_file_filepath('src/drivers/uart/config.c', 'test_both') )
|
|
612
|
-
.to eq('build/test/preprocess/files/test_both/drivers/uart/config.c')
|
|
653
|
+
.to eq('build/test/preprocess/files/test_both/_t_/src/drivers/uart/config.c')
|
|
613
654
|
expect( @fpu.form_preprocessed_file_full_expansion_filepath('src/drivers/uart/config.c', 'test_both') )
|
|
614
|
-
.to eq('build/test/preprocess/files/test_both/full_expansion/drivers/uart/config.c')
|
|
655
|
+
.to eq('build/test/preprocess/files/test_both/_t_/full_expansion/src/drivers/uart/config.c')
|
|
656
|
+
expect( @fpu.form_preprocessed_file_expanded_code_filepath('src/drivers/uart/config.c', 'test_both') )
|
|
657
|
+
.to eq('build/test/preprocess/files/test_both/_t_/expanded_code/src/drivers/uart/config.c')
|
|
615
658
|
expect( @fpu.form_preprocessed_file_raw_directives_only_filepath('src/drivers/uart/config.c', 'test_both') )
|
|
616
|
-
.to eq('build/test/preprocess/files/test_both/directives_only/raw/drivers/uart/config.c')
|
|
659
|
+
.to eq('build/test/preprocess/files/test_both/_t_/directives_only/raw/src/drivers/uart/config.c')
|
|
617
660
|
expect( @fpu.form_preprocessed_file_compacted_directives_only_filepath('src/drivers/uart/config.c', 'test_both') )
|
|
618
|
-
.to eq('build/test/preprocess/files/test_both/directives_only/drivers/uart/config.c')
|
|
661
|
+
.to eq('build/test/preprocess/files/test_both/_t_/directives_only/src/drivers/uart/config.c')
|
|
619
662
|
expect( @fpu.form_preprocessed_file_fallback_expansion_filepath('src/drivers/uart/config.c', 'test_both') )
|
|
620
|
-
.to eq('build/test/preprocess/files/test_both/fallback_expansion/drivers/uart/config.c')
|
|
663
|
+
.to eq('build/test/preprocess/files/test_both/_t_/fallback_expansion/src/drivers/uart/config.c')
|
|
621
664
|
expect( @fpu.form_preprocessed_includes_list_filepath('src/drivers/uart/config.c', 'test_both') )
|
|
622
|
-
.to eq('build/test/preprocess/includes/test_both/drivers/uart/config.c.yml')
|
|
665
|
+
.to eq('build/test/preprocess/includes/test_both/_t_/src/drivers/uart/config.c.yml')
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
it 'keeps a header far above the project below the test subdirectory' do
|
|
669
|
+
far = File.expand_path( '../../far/inc/sdk.h' )
|
|
670
|
+
expect( @fpu.form_preprocessed_file_filepath( far, 'test_both' ) )
|
|
671
|
+
.to eq( File.join( 'build/test/preprocess/files/test_both/_t_', BuildSubpath.of_directory( File.dirname( far ) ), 'sdk.h' ) )
|
|
672
|
+
expect( BuildSubpath.of_directory( File.dirname( far ) ) ).to_not include( '..' )
|
|
623
673
|
end
|
|
624
674
|
|
|
625
675
|
# The defect itself: two sources sharing a basename in one test.
|
|
@@ -638,12 +688,13 @@ describe FilePathUtils do
|
|
|
638
688
|
|
|
639
689
|
@fpu.form_preprocessed_file_raw_directives_only_filepath('src/drivers/uart/config.c', 'test_both')
|
|
640
690
|
@fpu.form_preprocessed_file_full_expansion_filepath('src/drivers/uart/config.c', 'test_both')
|
|
691
|
+
@fpu.form_preprocessed_file_expanded_code_filepath('src/drivers/uart/config.c', 'test_both')
|
|
641
692
|
@fpu.form_preprocessed_includes_list_filepath('src/drivers/uart/config.c', 'test_both')
|
|
642
693
|
end
|
|
643
694
|
|
|
644
|
-
it '
|
|
695
|
+
it 'places a header by its path from the project root' do
|
|
645
696
|
expect( @fpu.form_preprocessed_file_filepath('include/drivers/uart/config.h', 'test_both') )
|
|
646
|
-
.to eq('build/test/preprocess/files/test_both/drivers/uart/config.h')
|
|
697
|
+
.to eq('build/test/preprocess/files/test_both/_t_/include/drivers/uart/config.h')
|
|
647
698
|
end
|
|
648
699
|
|
|
649
700
|
# A generated Partial or mock sits below its own test's generated root rather than a
|
|
@@ -652,17 +703,17 @@ describe FilePathUtils do
|
|
|
652
703
|
it 'mirrors a generated Partial header below its own test root' do
|
|
653
704
|
expect(
|
|
654
705
|
@fpu.form_preprocessed_file_raw_directives_only_filepath(
|
|
655
|
-
'build/test/partials/test_both/drivers/uart/ceedling_partial_config_interface.h', 'test_both'
|
|
706
|
+
'build/test/partials/test_both/_t_/drivers/uart/ceedling_partial_config_interface.h', 'test_both'
|
|
656
707
|
)
|
|
657
|
-
).to eq('build/test/preprocess/files/test_both/directives_only/raw/drivers/uart/ceedling_partial_config_interface.h')
|
|
708
|
+
).to eq('build/test/preprocess/files/test_both/_t_/directives_only/raw/drivers/uart/ceedling_partial_config_interface.h')
|
|
658
709
|
end
|
|
659
710
|
|
|
660
711
|
it 'gives two same-named generated Partial headers distinct artifacts' do
|
|
661
712
|
uart = @fpu.form_preprocessed_file_raw_directives_only_filepath(
|
|
662
|
-
'build/test/partials/test_both/drivers/uart/ceedling_partial_config_interface.h', 'test_both'
|
|
713
|
+
'build/test/partials/test_both/_t_/drivers/uart/ceedling_partial_config_interface.h', 'test_both'
|
|
663
714
|
)
|
|
664
715
|
spi = @fpu.form_preprocessed_file_raw_directives_only_filepath(
|
|
665
|
-
'build/test/partials/test_both/drivers/spi/ceedling_partial_config_interface.h', 'test_both'
|
|
716
|
+
'build/test/partials/test_both/_t_/drivers/spi/ceedling_partial_config_interface.h', 'test_both'
|
|
666
717
|
)
|
|
667
718
|
|
|
668
719
|
expect( uart ).to_not eq(spi)
|
|
@@ -671,55 +722,156 @@ describe FilePathUtils do
|
|
|
671
722
|
it 'mirrors a generated mock below its own test root' do
|
|
672
723
|
expect(
|
|
673
724
|
@fpu.form_preprocessed_file_filepath(
|
|
674
|
-
'build/test/mocks/test_both/drivers/spi/mock_config.h', 'test_both'
|
|
725
|
+
'build/test/mocks/test_both/_t_/drivers/spi/mock_config.h', 'test_both'
|
|
675
726
|
)
|
|
676
|
-
).to eq('build/test/preprocess/files/test_both/drivers/spi/mock_config.h')
|
|
727
|
+
).to eq('build/test/preprocess/files/test_both/_t_/drivers/spi/mock_config.h')
|
|
677
728
|
end
|
|
678
729
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
730
|
+
it 'keeps a generated file directly in its test root flat' do
|
|
731
|
+
expect( @fpu.form_preprocessed_file_filepath('build/test/mocks/test_both/_t_/Mockconfig.h', 'test_both') )
|
|
732
|
+
.to eq('build/test/preprocess/files/test_both/_t_/Mockconfig.h')
|
|
733
|
+
end
|
|
734
|
+
|
|
735
|
+
# Without a test, a file still lies within the build directory
|
|
736
|
+
it 'places a file named for no test below the base every test shares' do
|
|
737
|
+
expect( @fpu.form_preprocessed_file_full_expansion_filepath('src/foo.h', nil) )
|
|
738
|
+
.to eq('build/test/preprocess/files/full_expansion/src/foo.h')
|
|
739
|
+
expect( @fpu.form_preprocessed_includes_list_filepath('src/foo.h', nil) )
|
|
740
|
+
.to eq('build/test/preprocess/includes/src/foo.h.yml')
|
|
684
741
|
end
|
|
685
742
|
end
|
|
686
743
|
|
|
687
|
-
|
|
744
|
+
# GH #1387: a long configured root's location gives way to its marker in build paths
|
|
745
|
+
describe 'shortened roots' do
|
|
746
|
+
let(:external_root) { '../vendor/acme/sdk/v3/include' }
|
|
747
|
+
let(:deep_root) { 'lib/vendor/acme/hal' }
|
|
748
|
+
let(:table) { BuildRoots.table( [external_root, deep_root, 'src'] ) }
|
|
749
|
+
|
|
688
750
|
before(:each) do
|
|
689
751
|
@configurator = double('configurator')
|
|
690
752
|
@file_wrapper = FileWrapper.new({
|
|
691
753
|
:loginator => double('loginator').as_null_object,
|
|
692
754
|
:verbosinator => double('verbosinator').as_null_object
|
|
693
755
|
})
|
|
694
|
-
@fpu =
|
|
695
|
-
:configurator => @configurator,
|
|
696
|
-
:file_wrapper => @file_wrapper
|
|
697
|
-
})
|
|
756
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
698
757
|
|
|
758
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [external_root, deep_root, 'src'] )
|
|
699
759
|
allow(@configurator).to receive(:extension_object).and_return( FilenameExtension.new('.o') )
|
|
700
|
-
allow(@configurator).to receive(:
|
|
701
|
-
allow(@configurator).to receive(:
|
|
760
|
+
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
761
|
+
allow(@configurator).to receive(:project_test_preprocess_files_path).and_return('build/test/preprocess/files')
|
|
762
|
+
allow(@configurator).to receive(:project_use_partials).and_return( false )
|
|
763
|
+
allow(@configurator).to receive(:project_use_mocks).and_return( false )
|
|
702
764
|
end
|
|
703
765
|
|
|
704
|
-
it '
|
|
766
|
+
it 'places objects below a shortened root at its marker, keeping their path below the root' do
|
|
705
767
|
objects = @fpu.form_test_build_objects_filelist(
|
|
706
|
-
'build/test/out/TestFoo', [
|
|
768
|
+
'build/test/out/TestFoo', ["#{external_root}/os/x.c", "#{deep_root}/y.c", 'src/drv/z.c']
|
|
707
769
|
)
|
|
708
|
-
|
|
709
|
-
expect( objects ).to
|
|
770
|
+
|
|
771
|
+
expect( objects ).to eq([
|
|
772
|
+
"build/test/out/TestFoo/#{table.marker_for( external_root )}/os/x.o",
|
|
773
|
+
"build/test/out/TestFoo/#{table.marker_for( deep_root )}/y.o",
|
|
774
|
+
'build/test/out/TestFoo/src/drv/z.o'
|
|
775
|
+
])
|
|
776
|
+
end
|
|
777
|
+
|
|
778
|
+
it 'places preprocessed files below a shortened root the same way' do
|
|
779
|
+
expect( @fpu.form_preprocessed_file_raw_directives_only_filepath( "#{external_root}/cmsis_os2.h", 'test_os' ) )
|
|
780
|
+
.to eq( "build/test/preprocess/files/test_os/_t_/directives_only/raw/#{table.marker_for( external_root )}/cmsis_os2.h" )
|
|
781
|
+
end
|
|
782
|
+
|
|
783
|
+
it 'names a test below a shortened root by its whole path, as always' do
|
|
784
|
+
expect( @fpu.form_test_name( "#{deep_root}/test/test_hal.c" ) ).to eq( "#{deep_root}/test/test_hal" )
|
|
785
|
+
end
|
|
786
|
+
|
|
787
|
+
it 'holds one table for the configured roots' do
|
|
788
|
+
expected = table.entries
|
|
789
|
+
expect(BuildRoots).to receive(:table).once.and_call_original
|
|
790
|
+
|
|
791
|
+
3.times { @fpu.build_roots }
|
|
792
|
+
expect( @fpu.build_roots.entries ).to eq( expected )
|
|
793
|
+
end
|
|
794
|
+
|
|
795
|
+
# gcov exclusions match the layout as it would be without shortened roots
|
|
796
|
+
it 'expands each marker in a build path back to its root\'s former spelling' do
|
|
797
|
+
marker = table.marker_for( external_root )
|
|
798
|
+
|
|
799
|
+
expect( @fpu.expanded_build_path( "build/gcov/out/test/test_os/#{marker}/os/x.gcno" ) )
|
|
800
|
+
.to eq( "build/gcov/out/test/test_os/#{BuildSubpath.encode( external_root )}/os/x.gcno" )
|
|
801
|
+
expect( @fpu.expanded_build_path( 'build/gcov/out/test/test_os/src/x.gcno' ) ).to eq( 'build/gcov/out/test/test_os/src/x.gcno' )
|
|
802
|
+
end
|
|
803
|
+
|
|
804
|
+
describe '#publish_build_roots' do
|
|
805
|
+
it 'writes each marker and its root to the build root, and returns them' do
|
|
806
|
+
expect(@file_wrapper).to receive(:mkdir).with( 'build' )
|
|
807
|
+
expect(@file_wrapper).to receive(:write) do |path, contents|
|
|
808
|
+
expect(path).to eq( 'build/build_roots.yml' )
|
|
809
|
+
expect(YAML.safe_load( contents )).to eq( table.entries.to_h { |root, marker| [marker, root] } )
|
|
810
|
+
end
|
|
811
|
+
|
|
812
|
+
expect( @fpu.publish_build_roots ).to eq( table.entries )
|
|
813
|
+
end
|
|
814
|
+
|
|
815
|
+
it 'removes the map when no root is shortened' do
|
|
816
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( ['src'] )
|
|
817
|
+
expect(@file_wrapper).to receive(:rm_f).with( 'build/build_roots.yml' )
|
|
818
|
+
expect(@file_wrapper).not_to receive(:write)
|
|
819
|
+
|
|
820
|
+
expect( @fpu.publish_build_roots ).to be_empty
|
|
821
|
+
end
|
|
822
|
+
end
|
|
823
|
+
end
|
|
824
|
+
|
|
825
|
+
describe '#form_test_build_objects_filelist' do
|
|
826
|
+
before(:each) do
|
|
827
|
+
@configurator = double('configurator')
|
|
828
|
+
@file_wrapper = FileWrapper.new({
|
|
829
|
+
:loginator => double('loginator').as_null_object,
|
|
830
|
+
:verbosinator => double('verbosinator').as_null_object
|
|
831
|
+
})
|
|
832
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
833
|
+
|
|
834
|
+
allow(@configurator).to receive(:extension_object).and_return( FilenameExtension.new('.o') )
|
|
835
|
+
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
836
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [] )
|
|
710
837
|
end
|
|
711
838
|
|
|
712
|
-
it '
|
|
839
|
+
it 'places a test, module-under-test or support source by its path from the project root' do
|
|
713
840
|
objects = @fpu.form_test_build_objects_filelist(
|
|
714
|
-
'build/test/out/TestFoo', ['test/TestFoo.c', '
|
|
841
|
+
'build/test/out/TestFoo', ['test/TestFoo.c', 'drivers/foo/bar.c', 'drivers/baz/bar.c', 'support/qux.c']
|
|
715
842
|
)
|
|
716
843
|
expect( objects ).to eq([
|
|
717
|
-
'build/test/out/TestFoo/TestFoo.o',
|
|
718
|
-
'build/test/out/TestFoo/
|
|
719
|
-
'build/test/out/TestFoo/
|
|
844
|
+
'build/test/out/TestFoo/test/TestFoo.o',
|
|
845
|
+
'build/test/out/TestFoo/drivers/foo/bar.o',
|
|
846
|
+
'build/test/out/TestFoo/drivers/baz/bar.o',
|
|
847
|
+
'build/test/out/TestFoo/support/qux.o'
|
|
720
848
|
])
|
|
721
849
|
end
|
|
722
850
|
|
|
851
|
+
# A source collected by one spelling and configured by another is still one source
|
|
852
|
+
it 'builds one file named by two spellings once, as no collision' do
|
|
853
|
+
objects = @fpu.form_test_build_objects_filelist(
|
|
854
|
+
'build/test/out/TestFoo', ['test/support/helper.c', './test/support/helper.c', 'build/vendor/c_exception/lib/CException.c', './build/vendor/c_exception/lib/CException.c']
|
|
855
|
+
)
|
|
856
|
+
expect( objects ).to eq(['build/test/out/TestFoo/test/support/helper.o', 'build/test/out/TestFoo/CException.o'])
|
|
857
|
+
end
|
|
858
|
+
|
|
859
|
+
# A source far from the project gains a directory for each level its path climbs, which
|
|
860
|
+
# can reach Windows' path length limit
|
|
861
|
+
# FileWrapper reports each path once, however often it is checked
|
|
862
|
+
it 'checks the length of each object\'s whole path, each time it is formed' do
|
|
863
|
+
expect(@file_wrapper).to receive(:check_path_length).with( 'build/test/out/TestFoo/_up_/_up_/far/src/x.o', origin: 'FilePathUtils#build_filepath' ).twice
|
|
864
|
+
|
|
865
|
+
2.times { @fpu.form_test_build_objects_filelist( 'build/test/out/TestFoo', ['../../far/src/x.c'] ) }
|
|
866
|
+
end
|
|
867
|
+
|
|
868
|
+
it 'leaves a runner or vendored framework source below the build root flat' do
|
|
869
|
+
objects = @fpu.form_test_build_objects_filelist(
|
|
870
|
+
'build/test/out/TestFoo', ['build/test/runners/TestFoo_runner.c', 'build/vendor/unity/src/unity.c']
|
|
871
|
+
)
|
|
872
|
+
expect( objects ).to eq(['build/test/out/TestFoo/TestFoo_runner.o', 'build/test/out/TestFoo/unity.o'])
|
|
873
|
+
end
|
|
874
|
+
|
|
723
875
|
# Generated Partial sources sit below their own build root, not a configured source
|
|
724
876
|
# root, so nothing in the standard roots mirrors them. Two modules sharing a basename
|
|
725
877
|
# then collapse onto one object filename.
|
|
@@ -739,7 +891,7 @@ describe FilePathUtils do
|
|
|
739
891
|
])
|
|
740
892
|
end
|
|
741
893
|
|
|
742
|
-
it 'leaves
|
|
894
|
+
it 'leaves a generated source flat when its root is not supplied' do
|
|
743
895
|
objects = @fpu.form_test_build_objects_filelist(
|
|
744
896
|
'build/test/out/TestFoo',
|
|
745
897
|
['build/test/partials/TestFoo/drivers/uart/ceedling_partial_config_impl.c']
|
|
@@ -756,26 +908,85 @@ describe FilePathUtils do
|
|
|
756
908
|
:loginator => double('loginator').as_null_object,
|
|
757
909
|
:verbosinator => double('verbosinator').as_null_object
|
|
758
910
|
})
|
|
759
|
-
@fpu =
|
|
760
|
-
:configurator => @configurator,
|
|
761
|
-
:file_wrapper => @file_wrapper
|
|
762
|
-
})
|
|
911
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
763
912
|
|
|
764
913
|
allow(@configurator).to receive(:extension_testpass).and_return( FilenameExtension.new('.pass') )
|
|
765
|
-
allow(@configurator).to receive(:
|
|
914
|
+
allow(@configurator).to receive(:project_build_root).and_return( 'build' )
|
|
915
|
+
allow(@file_wrapper).to receive(:check_path_length)
|
|
766
916
|
end
|
|
767
917
|
|
|
768
|
-
it 'mirrors each expected results file beneath the same test
|
|
918
|
+
it 'mirrors each expected results file beneath the same test name its own build directory uses' do
|
|
769
919
|
results = @fpu.form_pass_results_filelist(
|
|
770
920
|
'build/test/results', ['test/unit/test_foo.c', 'test/integration/test_foo.c']
|
|
771
921
|
)
|
|
772
|
-
expect( results ).to include('build/test/results/unit/test_foo.pass')
|
|
773
|
-
expect( results ).to include('build/test/results/integration/test_foo.pass')
|
|
922
|
+
expect( results ).to include('build/test/results/test/unit/test_foo.pass')
|
|
923
|
+
expect( results ).to include('build/test/results/test/integration/test_foo.pass')
|
|
774
924
|
end
|
|
775
925
|
|
|
776
|
-
it '
|
|
926
|
+
it 'places a test at its root beneath that root, as its name does' do
|
|
777
927
|
results = @fpu.form_pass_results_filelist('build/test/results', ['test/test_bar.c'])
|
|
778
|
-
expect( results ).to eq(['build/test/results/test_bar.pass'])
|
|
928
|
+
expect( results ).to eq(['build/test/results/test/test_bar.pass'])
|
|
929
|
+
end
|
|
930
|
+
|
|
931
|
+
# GH #1364: same-named tests at a root and below it, and under two roots
|
|
932
|
+
it 'gives same-named tests distinct results files' do
|
|
933
|
+
tests = ['test/test_calc.c', 'test/unit/test_calc.c', 'extra/unit/test_calc.c']
|
|
934
|
+
results = @fpu.form_pass_results_filelist( 'build/test/results', tests )
|
|
935
|
+
expect( results.uniq.size ).to eq(3)
|
|
936
|
+
end
|
|
937
|
+
|
|
938
|
+
it 'agrees with the results path each test is given' do
|
|
939
|
+
['test/test_calc.c', 'test/unit/test_calc.c', '../shared/test/test_s.c'].each do |test|
|
|
940
|
+
name = @fpu.form_test_name( test )
|
|
941
|
+
expected = @fpu.form_pass_results_filepath( @fpu.form_test_results_path( name, context: 'test' ), test )
|
|
942
|
+
expect( @fpu.form_pass_results_filelist( 'build/test/results', [test] ) ).to eq([expected])
|
|
943
|
+
end
|
|
944
|
+
end
|
|
945
|
+
end
|
|
946
|
+
|
|
947
|
+
describe '#form_test_name' do
|
|
948
|
+
before(:each) do
|
|
949
|
+
@fpu = path_utils( double('configurator'), double('file_wrapper') )
|
|
950
|
+
end
|
|
951
|
+
|
|
952
|
+
it 'names a test by its path from the project root, without its extension' do
|
|
953
|
+
expect( @fpu.form_test_name( 'test/test_calc.c' ) ).to eq('test/test_calc')
|
|
954
|
+
expect( @fpu.form_test_name( 'test/unit/test_calc.c' ) ).to eq('test/unit/test_calc')
|
|
955
|
+
end
|
|
956
|
+
|
|
957
|
+
# GH #1364: the same layout under two roots and a :files test outside every root
|
|
958
|
+
it 'keeps the root, so same-named tests under different roots get different names' do
|
|
959
|
+
names = ['test/foo/test_x.c', 'extra/foo/test_x.c', 'other/test_x.c'].map { |test| @fpu.form_test_name( test ) }
|
|
960
|
+
expect( names ).to eq(['test/foo/test_x', 'extra/foo/test_x', 'other/test_x'])
|
|
961
|
+
end
|
|
962
|
+
|
|
963
|
+
it 'gives one name however the path is written' do
|
|
964
|
+
expect( @fpu.form_test_name( './test/unit/test_calc.c' ) ).to eq('test/unit/test_calc')
|
|
965
|
+
expect( @fpu.form_test_name( 'test\\unit\\test_calc.c' ) ).to eq('test/unit/test_calc')
|
|
966
|
+
expect( @fpu.form_test_name( File.join( Dir.pwd, 'test/unit/test_calc.c' ) ) ).to eq('test/unit/test_calc')
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
it 'keeps a test outside the project inside the build directory' do
|
|
970
|
+
expect( @fpu.form_test_name( '../shared/test/unit/test_s.c' ) ).to eq('_up_/shared/test/unit/test_s')
|
|
971
|
+
expect( @fpu.form_test_name( '../../other/test_o.c' ) ).to eq('_up_/_up_/other/test_o')
|
|
972
|
+
end
|
|
973
|
+
|
|
974
|
+
it 'names an absolute path outside the project by its path from the project' do
|
|
975
|
+
outside = File.join( File.dirname( Dir.pwd ), 'shared', 'test', 'test_s.c' )
|
|
976
|
+
expect( @fpu.form_test_name( outside ) ).to eq('_up_/shared/test/test_s')
|
|
977
|
+
end
|
|
978
|
+
|
|
979
|
+
# A drive other than the working directory's, which on Windows may itself be C: or D:
|
|
980
|
+
it 'places a test on another Windows drive beneath its drive letter' do
|
|
981
|
+
drive = Dir.pwd.match?( /\A[Qq]:/ ) ? 'R' : 'Q'
|
|
982
|
+
|
|
983
|
+
expect( @fpu.form_test_name( "#{drive}:/work/test/test_x.c" ) ).to eq("_abs_/#{drive}/work/test/test_x")
|
|
984
|
+
expect( @fpu.form_test_name( "#{drive}:\\work\\test\\test_x.c" ) ).to eq("_abs_/#{drive}/work/test/test_x")
|
|
985
|
+
end
|
|
986
|
+
|
|
987
|
+
it 'names a test on the working directory\'s own Windows drive by its relative path', if: Dir.pwd.match?( /\A[A-Za-z]:/ ) do
|
|
988
|
+
inside = File.join( Dir.pwd, 'test', 'test_x.c' ).tr( '/', '\\' )
|
|
989
|
+
expect( @fpu.form_test_name( inside ) ).to eq('test/test_x')
|
|
779
990
|
end
|
|
780
991
|
end
|
|
781
992
|
|
|
@@ -784,34 +995,25 @@ describe FilePathUtils do
|
|
|
784
995
|
@configurator = double('configurator')
|
|
785
996
|
@file_wrapper = double('file_wrapper')
|
|
786
997
|
allow(@file_wrapper).to receive(:check_path_length)
|
|
787
|
-
@fpu =
|
|
788
|
-
:configurator => @configurator,
|
|
789
|
-
:file_wrapper => @file_wrapper
|
|
790
|
-
})
|
|
998
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
791
999
|
|
|
792
1000
|
allow(@configurator).to receive(:project_test_preprocess_includes_path).and_return('build/test/preprocess/includes')
|
|
793
|
-
|
|
1001
|
+
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
1002
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [] )
|
|
794
1003
|
allow(@configurator).to receive(:project_use_partials).and_return( false )
|
|
795
1004
|
allow(@configurator).to receive(:project_use_mocks).and_return( false )
|
|
796
|
-
allow(@configurator).to receive(:paths_source).and_return( [] )
|
|
797
|
-
allow(@configurator).to receive(:paths_support).and_return( [] )
|
|
798
|
-
allow(@configurator).to receive(:paths_include).and_return( [] )
|
|
799
|
-
allow(@configurator).to receive(:paths_test).and_return( ['test'] )
|
|
800
1005
|
end
|
|
801
1006
|
|
|
802
1007
|
it 'uses the fixed internal .yml extension regardless of a project-configured :extension ↳ :yaml setting' do
|
|
803
1008
|
expect(@configurator).to_not receive(:extension_yaml)
|
|
804
1009
|
expect( @fpu.form_preprocessed_includes_list_filepath('test/TestFoo.c', 'TestFoo') )
|
|
805
|
-
.to eq('build/test/preprocess/includes/TestFoo/TestFoo.c.yml')
|
|
1010
|
+
.to eq('build/test/preprocess/includes/TestFoo/_t_/test/TestFoo.c.yml')
|
|
806
1011
|
end
|
|
807
1012
|
end
|
|
808
1013
|
|
|
809
1014
|
describe '#form_partial_types_header_filename' do
|
|
810
1015
|
before(:each) do
|
|
811
|
-
@fpu =
|
|
812
|
-
:configurator => double('configurator'),
|
|
813
|
-
:file_wrapper => double('file_wrapper')
|
|
814
|
-
})
|
|
1016
|
+
@fpu = path_utils( double('configurator'), double('file_wrapper') )
|
|
815
1017
|
end
|
|
816
1018
|
|
|
817
1019
|
it 'forms a filename from the module name, the partial prefix, and a _types suffix' do
|
|
@@ -829,10 +1031,7 @@ describe FilePathUtils do
|
|
|
829
1031
|
describe 'the remaining generated Partial filenames' do
|
|
830
1032
|
before(:each) do
|
|
831
1033
|
@configurator = double('configurator')
|
|
832
|
-
@fpu =
|
|
833
|
-
:configurator => @configurator,
|
|
834
|
-
:file_wrapper => double('file_wrapper')
|
|
835
|
-
})
|
|
1034
|
+
@fpu = path_utils( @configurator, double('file_wrapper') )
|
|
836
1035
|
end
|
|
837
1036
|
|
|
838
1037
|
it 'forms an interface header filename with the partial prefix and an _interface suffix' do
|
|
@@ -874,10 +1073,7 @@ describe FilePathUtils do
|
|
|
874
1073
|
describe 'generated Partial filenames for a module named by directory' do
|
|
875
1074
|
before(:each) do
|
|
876
1075
|
@configurator = double('configurator')
|
|
877
|
-
@fpu =
|
|
878
|
-
:configurator => @configurator,
|
|
879
|
-
:file_wrapper => double('file_wrapper')
|
|
880
|
-
})
|
|
1076
|
+
@fpu = path_utils( @configurator, double('file_wrapper') )
|
|
881
1077
|
end
|
|
882
1078
|
|
|
883
1079
|
it 'prefixes the basename and keeps the directory for an implementation header' do
|
|
@@ -900,6 +1096,11 @@ describe FilePathUtils do
|
|
|
900
1096
|
.to eq('drivers/uart/ceedling_partial_config_types.h')
|
|
901
1097
|
end
|
|
902
1098
|
|
|
1099
|
+
it 'prefixes the basename and keeps the directory for an extras header' do
|
|
1100
|
+
expect( @fpu.form_partial_extras_header_filename('drivers/uart/config') )
|
|
1101
|
+
.to eq('drivers/uart/ceedling_partial_config_extras.h')
|
|
1102
|
+
end
|
|
1103
|
+
|
|
903
1104
|
it 'stacks both prefixes on the basename for a mock interface header' do
|
|
904
1105
|
allow(@configurator).to receive(:cmock_mock_prefix).and_return('Mock')
|
|
905
1106
|
|
|
@@ -920,10 +1121,7 @@ describe FilePathUtils do
|
|
|
920
1121
|
before(:each) do
|
|
921
1122
|
@configurator = double('configurator')
|
|
922
1123
|
allow(@configurator).to receive(:cmock_mock_prefix).and_return('Mock')
|
|
923
|
-
@fpu =
|
|
924
|
-
:configurator => @configurator,
|
|
925
|
-
:file_wrapper => double('file_wrapper')
|
|
926
|
-
})
|
|
1124
|
+
@fpu = path_utils( @configurator, double('file_wrapper') )
|
|
927
1125
|
end
|
|
928
1126
|
|
|
929
1127
|
it 'recovers a module named without a directory' do
|
|
@@ -936,7 +1134,7 @@ describe FilePathUtils do
|
|
|
936
1134
|
.to eq('drivers/uart/config')
|
|
937
1135
|
end
|
|
938
1136
|
|
|
939
|
-
#
|
|
1137
|
+
# One suffix exists per generated file kind.
|
|
940
1138
|
it 'strips an implementation suffix' do
|
|
941
1139
|
expect( @fpu.module_from_partial_filename('ceedling_partial_config_impl.h') ).to eq('config')
|
|
942
1140
|
end
|
|
@@ -945,6 +1143,10 @@ describe FilePathUtils do
|
|
|
945
1143
|
expect( @fpu.module_from_partial_filename('ceedling_partial_config_interface.h') ).to eq('config')
|
|
946
1144
|
end
|
|
947
1145
|
|
|
1146
|
+
it 'strips an extras suffix' do
|
|
1147
|
+
expect( @fpu.module_from_partial_filename('ceedling_partial_config_extras.h') ).to eq('config')
|
|
1148
|
+
end
|
|
1149
|
+
|
|
948
1150
|
it 'strips a types suffix' do
|
|
949
1151
|
expect( @fpu.module_from_partial_filename('ceedling_partial_config_types.h') ).to eq('config')
|
|
950
1152
|
end
|
|
@@ -980,27 +1182,77 @@ describe FilePathUtils do
|
|
|
980
1182
|
end
|
|
981
1183
|
end
|
|
982
1184
|
|
|
983
|
-
|
|
1185
|
+
# Each of a test's own directories sits below its root of that kind (TestBuildLayout)
|
|
1186
|
+
describe "a test's own directories" do
|
|
984
1187
|
before(:each) do
|
|
1188
|
+
@configurator = double('configurator')
|
|
985
1189
|
@file_wrapper = double('file_wrapper')
|
|
986
1190
|
allow(@file_wrapper).to receive(:check_path_length)
|
|
987
|
-
@
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1191
|
+
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
1192
|
+
allow(@configurator).to receive(:project_use_mocks).and_return( true )
|
|
1193
|
+
allow(@configurator).to receive(:project_use_partials).and_return( true )
|
|
1194
|
+
allow(@configurator).to receive(:cmock_mock_path).and_return('build/test/mocks')
|
|
1195
|
+
allow(@configurator).to receive(:project_test_partials_path).and_return('build/test/partials')
|
|
1196
|
+
allow(@configurator).to receive(:project_test_preprocess_includes_path).and_return('build/test/preprocess/includes')
|
|
1197
|
+
allow(@configurator).to receive(:project_test_preprocess_files_path).and_return('build/test/preprocess/files')
|
|
1198
|
+
allow(@configurator).to receive(:project_test_preprocess_build_directives_path).and_return('build/test/preprocess/build_directives')
|
|
1199
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
991
1200
|
end
|
|
992
1201
|
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
@fpu.
|
|
996
|
-
expect(@
|
|
997
|
-
|
|
1202
|
+
it "places each below the test's own root of its kind" do
|
|
1203
|
+
expect( @fpu.form_test_build_path( 'test/test_c', context: :test ) ).to eq('build/test/out/test/test_c/_t_')
|
|
1204
|
+
expect( @fpu.form_test_dependencies_path( 'test/test_c', context: :test ) ).to eq('build/test/dependencies/test/test_c/_t_')
|
|
1205
|
+
expect( @fpu.form_test_mocks_path( 'test/test_c' ) ).to eq('build/test/mocks/test/test_c/_t_')
|
|
1206
|
+
expect( @fpu.form_test_partials_path( 'test/test_c' ) ).to eq('build/test/partials/test/test_c/_t_')
|
|
1207
|
+
expect( @fpu.form_test_preprocess_includes_path( 'test/test_c' ) ).to eq('build/test/preprocess/includes/test/test_c/_t_')
|
|
1208
|
+
expect( @fpu.form_test_preprocess_files_path( 'test/test_c' ) ).to eq('build/test/preprocess/files/test/test_c/_t_')
|
|
1209
|
+
expect( @fpu.form_test_preprocess_build_directives_path( 'test/test_c' ) ).to eq('build/test/preprocess/build_directives/test/test_c/_t_')
|
|
1210
|
+
end
|
|
1211
|
+
|
|
1212
|
+
it "places each preprocessing directory below the test's own root" do
|
|
1213
|
+
expect( @fpu.form_test_preprocess_files_full_expansion_path( 'test/test_c' ) )
|
|
1214
|
+
.to eq('build/test/preprocess/files/test/test_c/_t_/full_expansion')
|
|
1215
|
+
expect( @fpu.form_test_preprocess_files_directives_only_path( 'test/test_c' ) )
|
|
1216
|
+
.to eq('build/test/preprocess/files/test/test_c/_t_/directives_only')
|
|
1217
|
+
expect( @fpu.form_test_preprocess_files_raw_directives_only_path( 'test/test_c' ) )
|
|
1218
|
+
.to eq('build/test/preprocess/files/test/test_c/_t_/directives_only/raw')
|
|
998
1219
|
end
|
|
999
1220
|
|
|
1000
|
-
it '
|
|
1001
|
-
@
|
|
1221
|
+
it "places a test's executable and linker map below its own root" do
|
|
1222
|
+
allow(@configurator).to receive(:extension_executable).and_return( FilenameExtension.new('.out') )
|
|
1223
|
+
allow(@configurator).to receive(:extension_map).and_return( FilenameExtension.new('.map') )
|
|
1224
|
+
build = @fpu.form_test_build_path( 'test/test_c', context: :test )
|
|
1225
|
+
|
|
1226
|
+
expect( @fpu.form_test_executable_filepath( build, 'test/test_c.c' ) ).to eq('build/test/out/test/test_c/_t_/test_c.out')
|
|
1227
|
+
expect( @fpu.form_test_build_map_filepath( build, 'build/test/out/test/test_c/_t_/test_c.out' ) ).to eq('build/test/out/test/test_c/_t_/test_c.map')
|
|
1228
|
+
end
|
|
1229
|
+
|
|
1230
|
+
# A test's name continues another's, and that test's mock lies in a folder of the same name
|
|
1231
|
+
it "keeps a nested test's directories apart from another test's subdirectory of its name" do
|
|
1232
|
+
expect( @fpu.form_test_mocks_path( 'test/test_c/test_x' ) ).to eq('build/test/mocks/test/test_c/test_x/_t_')
|
|
1233
|
+
expect( @fpu.form_mock_header_filepath( 'test/test_c', 'test_x/mock_qux.h' ) ).to eq('build/test/mocks/test/test_c/_t_/test_x/mock_qux.h')
|
|
1234
|
+
|
|
1235
|
+
expect( @fpu.form_test_partials_path( 'test/test_c/test_x' ) ).to eq('build/test/partials/test/test_c/test_x/_t_')
|
|
1236
|
+
expect( @fpu.form_partial_header_filepath( 'test/test_c', 'test_x/ceedling_partial_qux_impl.h' ) )
|
|
1237
|
+
.to eq('build/test/partials/test/test_c/_t_/test_x/ceedling_partial_qux_impl.h')
|
|
1238
|
+
end
|
|
1239
|
+
|
|
1240
|
+
it "keeps a context's own output root for no test" do
|
|
1241
|
+
expect( @fpu.form_test_build_path( nil, context: :gcov ) ).to eq('build/gcov/out')
|
|
1242
|
+
expect( @fpu.form_test_dependencies_path( nil, context: :gcov ) ).to eq('build/gcov/dependencies')
|
|
1243
|
+
end
|
|
1244
|
+
|
|
1245
|
+
it "gives a test's generated roots, Partials first" do
|
|
1246
|
+
expect( @fpu.generated_roots( 'test/test_c' ) ).to eq(['build/test/partials/test/test_c/_t_', 'build/test/mocks/test/test_c/_t_'])
|
|
1247
|
+
expect( @fpu.generated_roots( nil ) ).to eq([])
|
|
1248
|
+
end
|
|
1249
|
+
|
|
1250
|
+
it "checks a root's length once, naming the layout as the origin" do
|
|
1251
|
+
@fpu.form_test_preprocess_files_full_expansion_path( 'test/test_c' )
|
|
1252
|
+
|
|
1253
|
+
expect(@file_wrapper).to have_received(:check_path_length).once
|
|
1002
1254
|
expect(@file_wrapper).to have_received(:check_path_length)
|
|
1003
|
-
.with('build/test/preprocess/files/
|
|
1255
|
+
.with('build/test/preprocess/files/test/test_c/_t_', origin: 'TestBuildLayout#root', directory: true)
|
|
1004
1256
|
end
|
|
1005
1257
|
end
|
|
1006
1258
|
|
|
@@ -1010,10 +1262,8 @@ describe FilePathUtils do
|
|
|
1010
1262
|
@file_wrapper = double('file_wrapper')
|
|
1011
1263
|
allow(@file_wrapper).to receive(:check_path_length)
|
|
1012
1264
|
allow(@configurator).to receive(:project_build_root).and_return('build')
|
|
1013
|
-
@
|
|
1014
|
-
|
|
1015
|
-
:file_wrapper => @file_wrapper
|
|
1016
|
-
})
|
|
1265
|
+
allow(@configurator).to receive(:collection_build_roots).and_return( [] )
|
|
1266
|
+
@fpu = path_utils( @configurator, @file_wrapper )
|
|
1017
1267
|
end
|
|
1018
1268
|
|
|
1019
1269
|
# form_build_context_path is private -- exercised via #send, same as its callers do internally.
|