Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --no-exclude-limit`
# on 2026-11-10 17:00:20 UTC using RuboCop version 1.91.0.
# on 2026-11-12 20:27:23 UTC using RuboCop version 1.91.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -36,7 +36,7 @@ Lint/UnusedMethodArgument:
- 'plugins/gcov/lib/gcov_reportinator.rb'
- 'spec/units/plugins/tests_reporter_spec.rb'

# Offense count: 165
# Offense count: 162
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Exclude:
Expand All @@ -62,7 +62,6 @@ Metrics/AbcSize:
- 'lib/ceedling/dependencies/gcc_dependency_parser.rb'
- 'lib/ceedling/filesystem/file_finder.rb'
- 'lib/ceedling/generators/generator.rb'
- 'lib/ceedling/generators/generator_partials.rb'
- 'lib/ceedling/generators/generator_test_results.rb'
- 'lib/ceedling/generators/generator_test_results_backtrace.rb'
- 'lib/ceedling/generators/generator_test_results_sanity_checker.rb'
Expand Down Expand Up @@ -196,7 +195,7 @@ Metrics/ClassLength:
- 'plugins/gcov/lib/reportgenerator_reportinator.rb'
- 'plugins/valgrind/lib/valgrind.rb'

# Offense count: 87
# Offense count: 83
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/CyclomaticComplexity:
Exclude:
Expand All @@ -216,15 +215,13 @@ Metrics/CyclomaticComplexity:
- 'lib/ceedling/dependencies/dependency_differ.rb'
- 'lib/ceedling/dependencies/dependency_tracker.rb'
- 'lib/ceedling/filesystem/file_finder.rb'
- 'lib/ceedling/generators/generator_partials.rb'
- 'lib/ceedling/generators/generator_test_results.rb'
- 'lib/ceedling/generators/generator_test_results_backtrace.rb'
- 'lib/ceedling/generators/generator_test_results_sanity_checker.rb'
- 'lib/ceedling/includes/includes.rb'
- 'lib/ceedling/loginator.rb'
- 'lib/ceedling/partials/partializer.rb'
- 'lib/ceedling/partials/partializer_config.rb'
- 'lib/ceedling/partials/partializer_helper.rb'
- 'lib/ceedling/plugins/plugin_manager.rb'
- 'lib/ceedling/plugins/plugin_reportinator_helper.rb'
- 'lib/ceedling/preprocess/c_comment_scanner.rb'
Expand Down Expand Up @@ -252,7 +249,7 @@ Metrics/CyclomaticComplexity:
- 'plugins/gcov/lib/gcovr_reportinator.rb'
- 'plugins/gcov/lib/reportgenerator_reportinator.rb'

# Offense count: 245
# Offense count: 240
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Exclude:
Expand Down Expand Up @@ -284,7 +281,6 @@ Metrics/MethodLength:
- 'lib/ceedling/flaginator.rb'
- 'lib/ceedling/generators/generator.rb'
- 'lib/ceedling/generators/generator_mocks.rb'
- 'lib/ceedling/generators/generator_partials.rb'
- 'lib/ceedling/generators/generator_test_results.rb'
- 'lib/ceedling/generators/generator_test_results_backtrace.rb'
- 'lib/ceedling/generators/generator_test_results_sanity_checker.rb'
Expand Down Expand Up @@ -348,7 +344,7 @@ Metrics/ParameterLists:
- 'lib/ceedling/generators/generator.rb'
- 'lib/ceedling/loginator.rb'

# Offense count: 70
# Offense count: 67
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/PerceivedComplexity:
Exclude:
Expand All @@ -367,15 +363,13 @@ Metrics/PerceivedComplexity:
- 'lib/ceedling/dependencies/dependency_cache_store.rb'
- 'lib/ceedling/dependencies/dependency_tracker.rb'
- 'lib/ceedling/filesystem/file_finder.rb'
- 'lib/ceedling/generators/generator_partials.rb'
- 'lib/ceedling/generators/generator_test_results.rb'
- 'lib/ceedling/generators/generator_test_results_backtrace.rb'
- 'lib/ceedling/generators/generator_test_results_sanity_checker.rb'
- 'lib/ceedling/includes/includes.rb'
- 'lib/ceedling/loginator.rb'
- 'lib/ceedling/partials/partializer.rb'
- 'lib/ceedling/partials/partializer_config.rb'
- 'lib/ceedling/partials/partializer_helper.rb'
- 'lib/ceedling/plugins/plugin_manager.rb'
- 'lib/ceedling/plugins/plugin_reportinator_helper.rb'
- 'lib/ceedling/preprocess/preprocessinator_file_assembler.rb'
Expand Down
13 changes: 13 additions & 0 deletions assets/fixtures/tests_with_partials_coverage/src/tally.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "tally.h"
int tally(void) {
static struct {
int count;
} state; // A type and its variable, promoted together from three lines

state.count++; // Must independently report as hit

return state.count; // Must independently report as hit
}

// Lines 6 and 8 above are deliberately blank; they must never absorb the hits
// that belong to lines 7 and 9; see gcov_partials_coverage_promoted_type.
4 changes: 4 additions & 0 deletions assets/fixtures/tests_with_partials_coverage/src/tally.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#ifndef TALLY_H
#define TALLY_H
int tally(void);
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "unity.h"
#include "ceedling.h"
#include TEST_PARTIAL_ALL_MODULE(tally)
#include "tally.h"

void test_tally(void) {
TEST_ASSERT_EQUAL(1, tally());
TEST_ASSERT_EQUAL(1, PARTIAL_LOCAL_VAR(tally, state).count);
}
5 changes: 4 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Each release has its own section, listing only what changed in that release.
- [#1400](https://github.com/ThrowTheSwitch/Ceedling/issues/1400) Fixed a [Partial](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/) 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](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/conventions/#fallback-test-build-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](https://github.com/ThrowTheSwitch/Ceedling/issues/1402) Fixed a [Partial](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/) 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](https://github.com/ThrowTheSwitch/Ceedling/issues/1404) Fixed a [Partial](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/) 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](https://github.com/ThrowTheSwitch/Ceedling/issues/1401) Fixed a [Partial](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/) 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](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/variables/#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](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/) 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](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/) 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]`.

### Preprocessing
Expand All @@ -45,7 +47,8 @@ Each release has its own section, listing only what changed in that release.

## 🌟 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.
- 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.
- Added `PARTIAL_TYPE()` and `PARTIAL_LOCAL_TYPE()` to `ceedling.h`. Each names the type a [Partial](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/) 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](https://docs.throwtheswitch.org/Ceedling/1.2.0/reference/partials-macros/#variable-type-names)).
- [#1386](https://github.com/ThrowTheSwitch/Ceedling/issues/1386) Added [`:project` ↳ `:win_path_limit`](https://docs.throwtheswitch.org/Ceedling/1.2.0/configuration/reference/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`](https://docs.throwtheswitch.org/Ceedling/1.2.0/configuration/reference/tools/#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`](https://docs.throwtheswitch.org/Ceedling/1.2.0/configuration/reference/partials/#suppress_redundant_decls). Enabled by default, it wraps the prototypes a [Partial](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/) carries in GCC diagnostic pragmas, so `-Wredundant-decls` stays quiet where a carried prototype repeats a header’s declaration.
- Added [`:partials` ↳ `:extern_variables`](https://docs.throwtheswitch.org/Ceedling/1.2.0/configuration/reference/partials/#extern_variables) for a variable a module declares `extern` but never defines. `:weak`, the default, writes a weak definition in the [Partial](https://docs.throwtheswitch.org/Ceedling/1.2.0/testing-guide/partials/), 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.
Expand Down
Loading
Loading