Repository navigation
🐛 Lock Ceedling work by build root; keep same-named files' coverage counters (Ceedling 1.2.1 validation) - #27
Merged
mkarlesky merged 2 commits intoOct 24, 2026
Conversation
…ge counters Projects in different directories sharing a build root, e.g. through a common mixin setting :project: :build_root:, ran builds at once and read each other's reports. Every Ceedling command now holds a lock keyed by the resolved build root as well as the project directory, taken in sorted order through KeyedLock.runAll(). A --test-case collision's whole-file fallback cleared the counters of every test file with the same name. It now clears only the counters beneath the file's own directory within its test path, as Ceedling 1.2.0 and later lay them out. The --force-test-rerun comments give the reason that holds on Ceedling 1.2.1: delta builds ignore deleted coverage counters. The same-named-file coverage warning, README, KnownIssues, and CHANGELOG say what each Ceedling version does with an ambiguous name, and name 1.2.1 as supported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From Ceedling 1.2.0 a test builds under its file's directory within the longest test path holding it, e.g. unit/test_foo for test/unit/test_foo.c under +:test/**. testBuildName() mirrors Ceedling's PathMirror over the resolved :paths: :test:, with decorators and globs stripped, so a coverage fallback clears exactly its test's counters and a debug build finds exactly its executable, instead of matching trailing directories or taking the newest build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes from validating
next_versionagainst a Ceedling 1.2.1 dev build (with the fixes for Ceedling #1360, #1361, #1362), plus the real-Ceedling gates on 1.0.0, 1.1.0, 1.1.10 and 1.2.0.Fixes
build/vendorrewrites before 1.2.1, the CppUnit report, Cobertura reports and gcov counters. Projects in different directories that share one (e.g. a mixin inceedlingExplorer.mixinssetting:project: :build_root:) built at once and read each other's reports. Reproduced with real Ceedling 1.2.1: 4 tests errored from another project's report. Every Ceedling command now runs insideexclusively(), which holdsdirectory:andbuild:keys through the newKeyedLock.runAll(). The keys are deduplicated and taken in sorted order, so callers can't deadlock.--test-casecollision fallback cleared same-named files' counters (reachable from 1.2.1).clearTestCounters()matched any counter directory named for the file. 1.2.1 lays outgcov/out/<test dir>/<name>/…, sounit/test_dup.clost its coverage whenintegration/test_dup.c's fallback ran. Reproduced: a passing test showed 0 hits. The newtestBuildName()names each test's build directory exactly as Ceedling does. It mirrors Ceedling'sPathMirror.relative_subdirover the resolved:paths: :test:, with+:/-:decorators and globs stripped, and the longest root holding the file wins. The fallback now clears only that directory's counters, case-folded on Windows.executableSubpath()uses the same name for debug executables, replacing its "newest build" guess. Before 1.2.0 the name is flat (nestedTestBuildscapability).--force-test-rerunstays on 1.2.1. A real-Ceedling probe showed that a counter reset without the flag gives an all-zero report on 1.2.1 too. The comments now give that reason, so nobody drops the flag for 1.2.1.coverageCommandArgsrow was stale for 1.2.1.Ambiguous file reference; earlier versions may run the other file.Verification
just test: 458 unit and 18 integration tests.just lint: 0 findings.just coverage:ceedlingEngine.tsandconcurrency.tsat 100% lines, and branch coverage at the baseline.+:test/**,+:extra/**) on 1.2.0 and 1.2.1: exact executables and counters.Observed in Ceedling (not this extension)
test/unit/test_calc.cunder+:test/unit/**besideextra/unit/test_calc.cunder+:extra/**, where one test's build name (test_calc) ends the other's path. Every build stops withEXCEPTION: Ambiguous file reference 'test_calc.c'. Only such layouts could tell the old trailing-directory heuristic from the exact rule. Layouts Ceedling builds, e.g.+:test/**and+:extra/**holdingtest/unit/test_calc.candextra/integration/test_calc.c, pass with real Ceedling 1.2.0 and 1.2.1: exact debug executables, and a collision fallback that keeps the other file's coverage.Review findings deferred
dumpconfigcan rewrite a shared build root's vendored files under another project's build. That happens only for a project added during a sibling's run. Locking every known build root would make all discovery wait behind runs. It's documented in code and Development.md.🤖 Generated with Claude Code