From f5460d8f2194518d757ce4fb6a1ed6d2d018bc7f Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Sat, 28 Dec 2024 09:38:08 -0500 Subject: [PATCH] Update docs to include latest feature tweak. --- .gitignore | 1 + docs/CeedlingPacket.md | 16 +++++++++++++++- docs/Changelog.md | 2 ++ spec/spec_system_helper.rb | 21 +++++++++++++++++++++ spec/system/deployment_as_gem_spec.rb | 1 + spec/system/deployment_as_vendor_spec.rb | 1 + 6 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b3cb00bb..bd13be2b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ out.fail tags *.taghl +build/ examples/temp_sensor/vendor/ examples/temp_sensor/build/ plugins/fff/examples/fff_example/build/ diff --git a/docs/CeedlingPacket.md b/docs/CeedlingPacket.md index b7c9d0ff..1ce40fcc 100644 --- a/docs/CeedlingPacket.md +++ b/docs/CeedlingPacket.md @@ -2720,7 +2720,7 @@ and migrated to the `:test_build` and `:release_build` sections. accessible system search path. * `:none` disables preprocessing. - * `:all` enables preprpocessing for all mockable header files and test C files. + * `:all` enables preprocessing for all mockable header files and test C files. * `:mocks` enables only preprocessing of header files that are to be mocked. * `:tests` enables only preprocessing of your test files. @@ -2728,6 +2728,20 @@ and migrated to the `:test_build` and `:release_build` sections. **Default**: `:none` +* `:use_deep_preprocessor` + + This option is an addon to `:use_test_preprocessor`. It allows Ceedling to + better support situations where definitions required for building might be + buried in the include chain. It directly lists all includes in the chain to + better track these. + + * `:none` disables deep preprocessing, leaving normal shallow mode. + * `:all` enables deep preprocessing for all mockable header files and test C files. + * `:mocks` enables deep preprocessing of header files that are to be mocked. + * `:tests` enables deep preprocessing of your test files. + + **Default**: `:none` + * `:test_file_prefix` Ceedling collects test files by convention from within the test file diff --git a/docs/Changelog.md b/docs/Changelog.md index 8ed5e278..da5c3259 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -420,6 +420,8 @@ In future revisions of Ceedling, support for `TEST_CASE()` and `TEST_RANGE()` wh Note: `:project` ↳ `:use_test_preprocessor` is no longer a binary setting (`true`/`false`). Mockable header file preprocessing can now be enabled with a `:mocks` setting while test files are left untouched by preprocessing. This should support the majority of advanced use cases for preprocessing. +Note: `:project` ↳ `:use_deep_preprocessor` is an additional setting which can be used to specify if the entire header include chain should be listed in generated mock and test files. Like the option above, it has options of `:none`, `:mocks`, `:tests` and `:all`. It is very likely `:none` or `:mocks` are the right choice for you. + ### Removed background task execution Background task execution for tool configurations (`:background_exec`) has been deprecated. This option was one of Ceedling’s earliest features attempting to speed up builds within the constraints of relying on Rake. This feature has rarely, if ever, been used in practice, and other, better options exist to manage any scenario that might motivate a background task. diff --git a/spec/spec_system_helper.rb b/spec/spec_system_helper.rb index 4278f112..97860f28 100644 --- a/spec/spec_system_helper.rb +++ b/spec/spec_system_helper.rb @@ -9,6 +9,7 @@ require 'tmpdir' require 'ceedling/yaml_wrapper' require 'spec_helper' +require 'deep_merge' def test_asset_path(asset_file_name) File.join(File.dirname(__FILE__), '..', 'assets', asset_file_name) @@ -463,6 +464,26 @@ def can_test_projects_unity_parameterized_test_cases_with_success end end + # NOTE: This is not supported in this release, therefore is not getting called. + def can_test_projects_unity_parameterized_test_cases_with_preprocessor_with_success + @c.with_context do + Dir.chdir @proj_name do + FileUtils.cp test_asset_path("test_example_with_parameterized_tests.c"), 'test/' + settings = { :project => { :use_test_preprocessor => :all, :use_deep_preprocessor => :mocks }, + :unity => { :use_param_tests => true } + } + @c.merge_project_yml_for_test(settings) + + output = `bundle exec ruby -S ceedling 2>&1` + expect($?.exitstatus).to match(0) # Since a test either pass or are ignored, we return success here + expect(output).to match(/TESTED:\s+\d/) + expect(output).to match(/PASSED:\s+\d/) + expect(output).to match(/FAILED:\s+\d/) + expect(output).to match(/IGNORED:\s+\d/) + end + end + end + def can_test_projects_with_preprocessing_for_test_files_symbols_undefined @c.with_context do Dir.chdir @proj_name do diff --git a/spec/system/deployment_as_gem_spec.rb b/spec/system/deployment_as_gem_spec.rb index e7604cf5..d8061fe1 100644 --- a/spec/system/deployment_as_gem_spec.rb +++ b/spec/system/deployment_as_gem_spec.rb @@ -41,6 +41,7 @@ it { can_test_projects_with_success_test_alias } it { can_test_projects_with_test_name_replaced_defines_with_success } it { can_test_projects_unity_parameterized_test_cases_with_success } + #it { can_test_projects_unity_parameterized_test_cases_with_preprocessor_with_success } it { can_test_projects_with_preprocessing_for_test_files_symbols_undefined } it { can_test_projects_with_preprocessing_for_test_files_symbols_defined } it { can_test_projects_with_preprocessing_for_mocks_success } diff --git a/spec/system/deployment_as_vendor_spec.rb b/spec/system/deployment_as_vendor_spec.rb index 9783aa38..3e7c9660 100644 --- a/spec/system/deployment_as_vendor_spec.rb +++ b/spec/system/deployment_as_vendor_spec.rb @@ -44,6 +44,7 @@ it { can_test_projects_with_success_test_alias } it { can_test_projects_with_test_name_replaced_defines_with_success } it { can_test_projects_unity_parameterized_test_cases_with_success } + #it { can_test_projects_unity_parameterized_test_cases_with_preprocessor_with_success } it { can_test_projects_with_preprocessing_for_test_files_symbols_undefined } it { can_test_projects_with_preprocessing_for_test_files_symbols_defined } it { can_test_projects_with_preprocessing_for_mocks_success }