Skip to content

Commit

Permalink
Update docs to include latest feature tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandervoord committed Dec 28, 2024
1 parent eecfa20 commit f5460d8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ out.fail
tags
*.taghl

build/
examples/temp_sensor/vendor/
examples/temp_sensor/build/
plugins/fff/examples/fff_example/build/
Expand Down
16 changes: 15 additions & 1 deletion docs/CeedlingPacket.md
Original file line number Diff line number Diff line change
Expand Up @@ -2720,14 +2720,28 @@ 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.

[test-preprocessing]: #preprocessing-behavior-for-tests

**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
Expand Down
2 changes: 2 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 21 additions & 0 deletions spec/spec_system_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/system/deployment_as_gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
1 change: 1 addition & 0 deletions spec/system/deployment_as_vendor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit f5460d8

Please sign in to comment.