Skip to content

Cover mocking two same-named headers in one test - #1325

Closed
mkarlesky wants to merge 1 commit into
next_versionfrom
test/same-named-traditional-mocks
Closed

mkarlesky wants to merge 1 commit into
next_versionfrom
test/same-named-traditional-mocks

Conversation

@mkarlesky

Copy link
Copy Markdown
Member

This PR adds a pending system example for a test that mocks two headers sharing a basename, each named by its directory. It is the traditional-mock counterpart of the pending Partial example in partials_module_disambiguation_spec.rb. Both stay pending until CMock and Unity can name a mock by its folder.

Changes

  • spec/system/same_named_modules_spec.rb: a new context mocks drivers/uart/config.h and drivers/spi/config.h in one test and expects it to build and pass. The example is marked pending with the upstream dependency named.
  • assets/fixtures/same_named_modules/test/test_both_configs_mocked_traditional.c: the fixture test.

Against today's CMock the build fails at compile, because both mock headers share one include guard. No library code changes.

A test mocking two headers that share a basename, each named by its
directory, is the traditional-mock counterpart of the pending Partial
example. It stays pending until CMock and Unity can name a mock by the
folder its #include names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mkarlesky

Copy link
Copy Markdown
Member Author

Folded into #1326, which carries this commit rebased onto next_version. Its example now passes there.

@mkarlesky mkarlesky closed this Oct 17, 2026
@mkarlesky
mkarlesky deleted the test/same-named-traditional-mocks branch October 18, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant