You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
💪 Fixed
#1385 Fixed the Bullseye plugin’sreport:bullseye task including Unity, generated test runners, and test files in its HTML and XML reports when run on the same command line as a fresh bullseye: build, as in ceedling bullseye:all report:bullseye. Its reports now leave out the same sources as automatic reports. With no coverage file yet, it reports that and writes nothing, rather than failing with a license hint.
Fixed one long build path being reported several times, once for each step that created or wrote it. Ceedling now reports each path once.
Fixed a flood of notices about headers sharing a directory being logged once for every pair of them, on every build and for every test, whether or not anything failed. A directory of 40 headers gave 780 lines. The guidance now appears only when a compilation fails with what looks like a redeclaration or conflicting types, once for each directory holding a header the compiler names, and explains how the collision can arise and how to resolve it.
#1387 Fixed long configured paths lengthening every build path below them (#1370). A :paths root far outside the project, such as a vendor’s include directory, or nested deep inside it, is now spelled in build paths by a short _<name>_<hash> name, and everything below it keeps its path. Short roots such as src/ are unchanged. build/build_roots.yml lists each shortened root (build output). The first build after upgrading rebuilds everything once.
#1391 Fixed a delta build reusing a test’s Partials after the test changed which functions it selects, such as TEST_PARTIAL_PUBLIC_MODULE to TEST_PARTIAL_ALL_MODULE. A change that rewrote only the preprocessed copies a Partial is made from, such as toggling :test_build ↳ :preprocess_force_fallback, was missed the same way. A Partial now regenerates when either changes.
#1408 Fixed a delta build recompiling some of a test’s objects on every run when Ceedling isolated a header beside one the test mocks. Nothing had changed, but each build gave the isolated copy a directory with a new name. A rebuild now weighs the original headers, so it compiles only what changed, and compiler messages about an isolated header name the original. Isolation also now runs only where it can help, for a mocked header with :cmock ↳ :treat_inlines: :include. With other mocks and with Partials it changed nothing, so its notice and second compile no longer appear there.
#1425 Fixed a delta build regenerating every mock when only --verbosity changed, and keeping every mock when the FFF plugin was turned on or off. A test rewritten for the other generator failed to compile until a clobber. Verbosity no longer counts as a change to a mock, and switching generators regenerates each one. The first build after upgrading regenerates every mock once.
#1428 Fixed a delta build ignoring edits to a mocked header after :cmock ↳ :treat_inlines changed from :include to :exclude. The copy of the header CMock wrote beside the mock stayed, and the build compiled against it until a clobber. A mock generated again now removes that copy.
#1434 Fixed a delta build ignoring edits to a header a test stopped mocking, with :cmock ↳ :treat_inlines: :include. The copy of the header CMock wrote beside the mock stayed in the test’s mock directory, which remains on the test’s search paths, and the build compiled against it until a clobber. With :use_test_preprocessor set to :tests or :all, the build stopped instead, reporting Found no file `build/test/mocks/test/test_c/drivers/foo.h` in search paths. Collecting a test’s #includes with test preprocessing also read the copy of a header the test still mocks, missing an edit to it that changes which other mocks the test needs. Each build now removes the copies no current mock names and keeps copies out of #include collection.
#1435 Fixed an FFF fake of a header holding an inline function failing to compile with :cmock ↳ :treat_inlines: :include, reporting a redefinition of the function. The fake included the original header, which defines the function the fake defines too. A fake now writes a copy of the header without its inline function bodies beside itself and includes that, as a mock does.
#1440 Fixed an FFF fake of a header with an extension other than .h, such as .hpp, failing to build. A fake of drivers/foox.hpp was written as drivers/mock_foox.hpp.h and drivers/mock_foox.hpp.c, so a test including drivers/mock_foox.hpp stopped with Found no file `drivers/mock_foox.c` in search paths., or with a missing-file error from the compiler under test preprocessing. A fake is now named as CMock names a mock, drivers/mock_foox.hpp and drivers/mock_foox.c. A CMock mock of such a header also no longer logs Failed to generate directive-only preprocessor output under test preprocessing, since its stand-in now takes the header’s own extension.
#1438 Fixed a delta build with mock preprocessing (:use_test_preprocessor set to :mocks or :all) generating a mock from an out-of-date reading of a header the mocked header includes. An edit to that header alone left the mock as it was. With :cmock ↳ :treat_inlines: :include, mock preprocessing could also read the copy of that header CMock wrote beside another mock. The mock kept the declarations the old header selected, and the test failed to build until a clobber. Mock preprocessing now reads each header the mocked header includes as the compiler finds it, and an edit to any of them regenerates the mock. The first build after upgrading preprocesses every mocked header once.
#1433 Fixed a mocked header that includes a header beside itself failing to build when an earlier search path holds a same-named header. With lib/motor.h including "config.h" and src/hw/config.h reached first, the header Ceedling prepares for CMock under mock preprocessing named lib/config.h, which nothing resolves from the build directory. The build stopped with fatal error: lib/config.h: No such file or directory. A test’s runner, CMock’s copy of a header under :cmock ↳ :treat_inlines: :include, and a Partial’s generated files could also include the same-named header in place of the one beside the includer. Each now includes such a header by its absolute path wherever no search path reaches it.
#1439 Fixed a test whose mock or Partial lies in a folder named like another test nested below it failing to build once that test exists. With test/test_c.c including "test_x/mock_qux.h" and test/test_c/test_x.c added, test:test_c stopped with Found no file `test_x/mock_qux.c` in search paths., and a Partial failed to link. A mock of the nested test could also overwrite the other test’s same-named mock. Each test’s own build directories now end in _t_ after its name, so no test’s directory lies inside another’s (build output). A test’s executable and linker map move with its objects (see Breaking Changes). The first test build after upgrading rebuilds every test once. Release builds are unaffected.
Fixed a hand-written source named with the mock prefix failing to build into a test. A fake such as src/fakes/mock_spi.c, linked through TEST_SOURCE_FILE("mock_spi.c"), stopped the build with Found no file `mock_spi.c` in search paths., since Ceedling looked for it only among the test’s generated mocks. A name with the Partial prefix failed the same way. A test’s own generated mock still comes first.
#1415 Fixed a header that only :files ↳ :include supplies being impossible to mock since 1.2.0. The build stopped with Found no file `sensor.h` in search paths. When a test names such a header, Ceedling now adds the directory its #include implies to that test’s search paths, after every configured one, and logs it. For a header outside the working directory, a bare name such as "mock_socket.h" gets no directory, and the build’s error suggests an #include that references the parent folder.
#1418 Fixed a mock or #include naming a header by a directory below a search path, as in #include "drivers/mock_foo.h" with src/ listed, stopping the build with Found no file `drivers/foo.h` in search paths. Ceedling now finds a test’s headers as the compiler does, joining each search path with the path the #include names (search paths). A build with :cmock ↳ :treat_inlines: :include also no longer reports “Multiple files matched” for CMock’s copy of a mocked header.
Fixed a mock included through a folder, as in #include "drivers/mock_foo.h", failing to compile when a search path lists only its header’s own directory, as src/drivers/** does. The mock included its header as "drivers/foo.h", which no search path reached. A mock now includes its header by the text a search path reaches it by, here "foo.h".
Fixed an FFF fake including its header by filename alone, even where its #include named a folder. With lib/ and src/** listed, a fake included as drivers/mock_foo.h included src/hw/drivers/foo.h in place of lib/drivers/foo.h, the header drivers/foo.h names. A fake now includes its header as a mock does.
Partials
#1427 Fixed a mock Partial stopping the build when its configuration named a function its module declares but doesn’t define, as MOCK_PARTIAL_PUBLIC_MODULE(port) with MOCK_PARTIAL_CONFIG(port, -port_write) does. The build reported references function 'port_write' which does not exist, though port.h declares it and port.c defines it. The check knew only the functions a module defines, and a mock of public functions alone, or any mock of a header-only module, reads no definitions from a source. A mock’s configuration can now name any function its module declares, except an inline one whose body is in another header, which no mock can replace.
#1384 Fixed a Partial leaving out what its selected functions rely on. A test calling an inline function whose external definition the module’s source provides, with a declaration such as extern inline int f(void); or int f(void);, failed to link. Selected code calling a function the module only declares, a function the test subtracted to stub, or a static inline helper from the module header failed to compile. A Partial now carries those prototypes and the helpers its selected code uses (what a Partial carries). A mock Partial also no longer mocks such a function, which defined it twice.
Fixed a Partial defining a variable its module declares extern, which failed to link against the real definition with GCC 10 and later. By default, a Partial now writes a weak definition that the real one overrides (see Added); this behavior is optional.
Fixed tested and mocked Partials dropping part of a function’s return type in certain circumstances. struct point *f(void) lost struct point, uint8_t * lost uint8_t, unsigned long became long, and const was stripped.
Fixed a Partial’s implementation header declaring a variable twice when the module’s header declares it and its source defines it, which -Wredundant-decls reports.
#1397 Fixed a Partial failing to compile for a module that declares a function pointer without a typedef for its type. A function taking or returning one, and a variable holding one, an array of them or a pointer to an array, now generate correctly whether tested or mocked. A variable whose array size, initializer or string holds a pointer in parentheses, as in sizeof(*p), is no longer named after that pointer. A function returning a function pointer no longer stops Ceedling with an internal error, and a defined function whose name a Partial can’t read stops the build with a message naming it (function pointers).
#1399 Fixed a Partial taking a struct, union, or enum variable for a type. A variable such as struct ops g_ops = { 1 };, or an array of them, went into the Partial’s types header, which defined it twice or failed to compile. A function returning a pointer to a struct, followed by a stray ;, was taken for a type the same way. A type with an attribute after its closing brace, as in } __attribute__((packed));, was taken for a variable instead and never reached the types header.
#1400 Fixed a Partial misreading several kinds of variable declaration, which left a variable without an extern or wrote one that failed to compile or link. Every variable of a compound declaration now gets an extern, as g_y does in int g_x = 0, g_y;. A name holding $ reads whole. A type spelled with typeof(…), _Atomic(…), _Alignas(…), or _BitInt(…), or with _Bool, _Atomic, _Thread_local, or _Complex, keeps its spelling. An extern keeps its variable’s asm label, as in int g_s __asm__("g_symbol");. Under fallback preprocessing, which remains a best effort, a comment inside a declaration no longer garbles it or stops a Partial reading the rest of the file.
#1402 Fixed a Partial failing to compile for a module whose source includes its own header and then a header that uses the module header’s types or macros. The Partial wrote every include it carries ahead of the module’s types, so the later header met a type or macro not yet defined. A Partial now writes its includes in the order the module’s source compiles them. A mocked Partial’s header among them keeps its place too.
#1404 Fixed a Partial misreading a declaration with a C23 attribute. A variable that one leads, as in [[maybe_unused]] static int count;, got an extern that failed to compile, and so did a variable whose name one follows. A function that one leads, as in [[nodiscard]] static int f(void) { … }, was never read, and neither was anything after it in the file. Each now reads whole, and its attribute keeps its place in the Partial.
#1401 Fixed a Partial failing to compile for a module that declares a variable together with its type, as in static struct { int count; } s_ctx; or struct pair { int a; } g_p1, g_p2;. The Partial repeated the type’s body in the variable’s extern and in its definition. It now defines the type once, in its types header, and names it for the variable (a variable declared together with its type). A function-scoped static of this form is promoted with its type. A member’s array size and the first variable of such a compound declaration, which the body used to lose, now read correctly.
Fixed a Partial reading a forward declaration, as in struct node;, as a variable. It wrote extern struct node;, which fails a build treating warnings as errors. A Partial now writes the declaration as the module does.
Fixed a Partial renaming more than a promoted function-scoped static variable. A member or tag of the same name, as in p->count, now keeps its spelling, unless a struct the function defines holds the name. So does the text of a comment or string, apart from an asm template’s %[count].
#1395 Fixed a Partial failing to compile for a module whose static comes from a macro, as #define PRIVATE static or #define STATICINLINE static inline gives. A selected function failed with “static declaration follows non-static declaration”, and a variable got an extern such as extern PRIVATE int counter;. A Partial now writes each from its expanded declaration, and every line of a function’s body keeps its place. A variable a macro such as #define EXTERN extern declares gets its weak definition too.
Fixed a Partial dropping an attribute a macro writes after a type’s closing brace, as in struct pk { char c; int i; } PACKED; or struct pk { char c; int i; } PACKED inst;. The Partial’s copy of the type compiled unpacked with only a warning, so its size disagreed with the module’s. A Partial now keeps the macro with the type.
Fixed a delta build reusing a Partial after a header its module includes changed, such as the header that defines PRIVATE. A Partial now regenerates when any project header its module’s preprocessing read changes.
Fixed a tested Partial running the real static inline functions of a module the test mocks as a Partial named by directory, as MOCK_PARTIAL_PUBLIC_MODULE_AT(hw, port) names one. Since 1.2.0 the tested Partial included that module’s real header in place of its mock’s. A module named by directory is now matched by its header’s path.
Fixed a module both tested and mocked as Partials in one test failing to compile when its source never includes its own header. The Partial’s implementation never included its mock’s interface, so a tested function calling a mocked one called it undeclared.
Preprocessing
#1423 Fixed a mock #include that climbs with .. stopping a test built with test preprocessing. #include "../x/mock_foo.h" for inc/x/foo.h with inc/** listed stopped the build with Found no file `../x/foo.h` in search paths., though it built without test preprocessing. The mock is now found as the #include reaches it from the test file’s directory.
#1424 Fixed a mock #include without a folder being dropped beside a same-named mock #include with one, as #include "mock_task.h" is beside #include "other/mock_task.h". The first mock was never generated, and the test failed to compile. Both mocks are now generated. Two #includes of one header’s mock still give it one mock, named by the #include with more path.
#1426 Fixed a header with two same-named #includes, one without a folder and one with, losing one of them in the copy Ceedling prepares for CMock and in a test’s own #include list. A mocked lib/motor.h that includes "config.h" and "app/config.h" failed to compile with :cmock ↳ :treat_inlines: :include. Both #includes are now kept, in either order. The notice about an #include that several files satisfy no longer counts a file another #include took.
#1420 Fixed a mock in a test built with test preprocessing taking its name from its header’s mirrored directory instead of the #include the test wrote. Since 1.2.0, #include "mock_task.h" for rtos/include/task.h with rtos/** listed defined include_mock_task_Init() and its siblings. That mock now defines mock_task_Init() and its siblings, as a build without test preprocessing does. A test that calls include_mock_task_Verify() directly must now call mock_task_Verify(). A mock whose #include changes its folder is now regenerated.
Fixed a mocked header losing a function declaration that follows an empty macro definition, such as #define CMSIS_DEPRECATED, with :cmock ↳ :treat_inlines: :include. In the header Ceedling prepares for CMock, the declaration could be joined onto the #define, so no mock was generated for that function.
Fixed a mid-line _Pragma() being joined into the code around it when Ceedling reassembled a preprocessed file, giving int a; #pragma pack(1) int b; on one line.
Fixed a header’s include guard going unrecognized behind a leading comment longer than 2,048 bytes, such as a license. A header prepared for CMock with :treat_inlines: :include got a generated guard instead and repeated the original guard’s #define as an ordinary macro, and a Partial of such a header could not suppress the original header, risking redefinition errors. A guard-shaped #ifndef/#define pair inside a comment is no longer taken for the guard.
Fixed a system header such as <stdint.h> being included twice in a header Ceedling prepares for CMock or a Partial, when the compiler’s own copy of that header includes another of the same name.
🌟 Added
More and better guidance on compilation and linking failures that point to common root causes. More cases are covered with more complete explanations and consistent wording. Failure matching is expanded to help across a variety of toolchains. A test whose Partials macro, such as PARTIAL_LOCAL_VAR(), builds a name nothing declares gets guidance on the macro’s arguments. An #include nested too deeply (#691) gets guidance at preprocessing or compilation. It names a header that includes its own filename and finds itself first.
#699 Added a check of each tool’s quoting when Ceedling validates its configuration (tool definitions). A quote that :executable or an argument leaves open fails validation and names the entry. A typographic quote such as ”, often pasted from a web page, draws a warning, and it is named as the likely cause of a quote left open. Before, a quote left open paired with one in a later argument. The build then failed with an unrelated error, such as no input files, or ran with corrupted paths.
Added PARTIAL_TYPE() and PARTIAL_LOCAL_TYPE() to ceedling.h. Each names the type a Partial gives a variable declared together with its type, so a test can declare another object of that type, such as a saved copy of a module’s state (Partials macros).
#1386 Added :project ↳ :win_path_limit for Windows. :classic, the default, keeps Windows’ 260-character limit and now also flags a directory Ceedling creates past 248 characters. :long_paths and :auto stop long path logging warnings/errors on a host with long paths enabled, after checking once that Ruby can work with long paths. If that check fails, the new optional :windows_registry_query tool reads the host’s registry setting to name the cause. On Ruby before 4.0, which can create long paths but not list them, :auto keeps the classic limit, and :long_paths warns once about what can fail. The setting changes only what Ceedling reports.
Added :partials ↳ :suppress_redundant_decls. Enabled by default, it wraps the prototypes a Partial carries in GCC diagnostic pragmas, so -Wredundant-decls stays quiet where a carried prototype repeats a header’s declaration.
Added :partials ↳ :extern_variables for a variable a module declares extern but never defines. :weak, the default, writes a weak definition in the Partial, so a test built with GCC or Clang links whether or not it links the defining module. :test writes none, leaving the definition to the test.
⚠️ Changed
A mocked Partial’s generated header is no longer preprocessed for mocking. CMock reads it as generated, so the work was never used. The pre_mock_preprocess and post_mock_preprocess plugin hooks, and the Command Hooks plugin’s hooks of the same names, no longer run for one.