Repository navigation
Give FFF fakes every :cmock include setting (#1377) - #1382
Merged
Merged
Conversation
The wrapper Ceedling swaps in for CMock had no specs. These drive it with Ceedling's :includes default and read back the fake it writes, one example per include setting, plus the merge, the quoting, and a Unity helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fake's source never got :includes_c_pre_header or :includes_c_post_header, which were passed under names never assigned. Its header never got :includes_h_pre_orig_header, which was read only when :includes was unset, and Ceedling always sets :includes. The lists now arrive, and the header's pre list merges both settings as CMock does. A Unity helper is therefore included in a fake's source, as in a mock's. The fake's directory is made with FileUtils, so the wrapper no longer leans on Rake's DSL mixed into Object. Closes #1377. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generate_mock splits its path and its file writes into two helpers, and the include lists share one quoting helper, so the wrapper carries no Metrics offenses. The fakes it writes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fff.rb leaves four Metrics entries. The FFF wrapper spec joins BlockLength beside the plugin's other specs. The backlog drops from 759 offenses to 755. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An include list entry is tested with match?, as before and as CMock does, so an entry YAML reads as a symbol still passes through. The wrapper spec keeps its repository path local rather than a top-level constant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fake prints nothing for errors only or warnings, announces itself at normal verbosity as CMock announces a mock, and names its files only at verbose. The examples no longer stub $stdout, so silence is checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each fake's file line printed at every verbosity. It now prints only at CMock's verbose level and names both files, and the announcement keeps CMock's normal level, so a fake reports itself as a mock does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The FFF page's CMock example nested its settings under :mock_prefix and left one list empty. It is corrected, and a table shows where each include setting puts its headers in a fake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI summary · f4274f5 · ✅ 25/25 jobs passed · nearest baseline 4f6f1b6 (master)
Diff coverage: 100.00% (23/23 changed lines).
All legs (examples / failures / pending)
Jobs
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1377.
Problem
The FFF plugin dropped
:cmockinclude settings that CMock honors, so a fake could fail to compile where a mock of the same header compiles.:includes_c_pre_headerand:includes_c_post_headernever reached a fake's.cfile. The wrapper passed them under names that were never assigned, so they were alwaysnil.:includes_h_pre_orig_headerwas read only when:includeswas unset. Ceedling always sets:includes(its default is[], which Ruby treats as true), so the setting was never read.Changes
FffCMockWrapperinplugins/fff/lib/fff.rb:.clists now reach the generator.:includesand:includes_h_pre_orig_header, removing duplicates, as CMock does.<stays as it is, and any other is quoted.:unity_helper_pathheader to the.cinclude list. A fake's.cnow includes the helper, as a mock's does.FileUtilsinstead of Rake's helpers, so the wrapper no longer depends on Ceedling having loaded Rake.Console output follows CMock's verbosity scheme. Ceedling already passes the wrapper CMock's verbosity, through the same config it hands CMock.
Lint.
fff.rbgoes from 5 Metrics offenses to 0 and leaves four to-do entries. The backlog drops from 759 offenses to 755.Docs.
:mock_prefixand left one list empty. It's corrected, and a table now shows where each include setting puts its headers in a fake.Verification
plugins/fff/spec/fff_cmock_wrapper_spec.rbdrives the wrapper with Ceedling's:includesdefault.fff_examplebuild passes, 11 of 11. At normal verbosity it prints no FFF lines; at debug it prints both lines for each fake.#include "extra_c.h"lands in both the.cand the.h, and the helper appears in each.c.Left alone
:subdirset, FFF puts the subdirectory after the include folder, while CMock puts it before. Ceedling does nothing with:subdiritself.puts, as CMock does. Routing them through Ceedling's logging waits for the plugin redesign.🤖 Generated with Claude Code