Skip to content

refactor(tests): drop _project_root_fwd indirection; align test -I paths with rest of codebase - #2327

Merged
zackees merged 1 commit into
masterfrom
normalize-test-include-paths
Apr 18, 2026
Merged

zackees merged 1 commit into
masterfrom
normalize-test-include-paths

Conversation

@zackees

@zackees zackees commented Apr 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Drop the intermediate _project_root_fwd = meson.project_source_root() / '.' in tests/meson.build.
  • Use meson.project_source_root() / 'src' directly, matching the spelling used by every other meson file in the repo.

What this fixes

Before this change, tests/meson.build produced:

-IC:/Users/niteris/dev/fastled6/./src

Every other meson file (ci/meson/native/meson.build lines 438, 469, 524; examples/meson.build line 172) produces:

-IC:/Users/niteris/dev/fastled6/src

When the test DLL links against fastled_lib / crash_handler_lib, both spellings of the same directory land on the compile line as distinct -I flags. Clang keys #pragma once on the resolved path string, so two spellings of the same directory can defeat deduplication even though they refer to the same file.

What this does NOT fix

This is a cleanup, not a #pragma once fix. Removing the /./ did not fully resolve the VibeLevels redefinition error that #2325 addressed; there's a deeper PCH+clang path-handling issue on Windows toolchains that the #ifndef guard in #2325 handles defensively.

This PR just shrinks the -I surface area so any future investigation is working from clean paths.

Test plan

  • bash test --cpp all 299/299 unit tests + examples still pass
  • CI green

Follow-up issues filed for the broader path-normalization effort and a proposed zccache strict-paths mode.

Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated test compilation include paths to ensure consistency with project build configuration, preventing clang pragma once failures during test builds.

…ibling -I spellings

The test include args were chaining `meson.project_source_root() / '.' / 'src'`
which produces `C:/.../fastled6/./src` with a `/./` in the middle of the path.
Every other meson file uses `meson.project_source_root() / 'src'` directly,
producing `C:/.../fastled6/src` — a cleaner spelling.

When the test DLL links against fastled_lib / crash_handler_lib, Meson
ends up putting both spellings of the same directory on the compile line
as distinct -I flags. Clang keys #pragma once on the resolved path string,
so two spellings of the same directory can defeat the deduplication even
though they refer to the same file.

This change aligns the test -I spelling with the rest of the codebase
(ci/meson/native/meson.build lines 438, 469, 524 and examples/meson.build
line 172 all already use the clean spelling).

Note: this is a cleanup, not a #pragma once fix. The redefinition error
seen when vibe.h is included via both audio_processor.h and
tests/fl/audio/detector/vibe.hpp is a deeper PCH+clang issue on Windows
toolchains; the defensive ifndef guard added in #2325 is the working
fix. This PR just removes an unnecessary path inconsistency so the
overall -I surface area is smaller and any future investigation is
working from clean paths.

Verified: bash test --cpp all 299/299 tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 18, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8606635c-5a22-4698-a347-3b68f78cf5f8

📥 Commits

Reviewing files that changed from the base of the PR and between cafcfb3 and 2698b9f.

📒 Files selected for processing (1)
  • tests/meson.build

📝 Walkthrough

Walkthrough

Updated test_abs_include_args in the Meson build script to use direct meson.project_source_root() paths instead of an intermediate normalized variable, removing _project_root_fwd. This standardizes -I path spellings to match those emitted by other library builds, preventing clang #pragma once failures from inconsistent directory representations.

Changes

Cohort / File(s) Summary
Build Configuration
tests/meson.build
Replaced intermediate _project_root_fwd variable with direct meson.project_source_root() expressions in test_abs_include_args for project root and src include paths; ensures consistent path spellings to resolve pragma once conflicts with fastled_lib/crash_handler_lib builds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Paths once tangled, now made clear and bright,
No more /./ confusion—pragma once takes flight!
A rabbit hops through meson, tweaking with care,
Spelling paths consistent, fixing issues with flair! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: removing the _project_root_fwd indirection and aligning test include paths with the rest of the codebase, which directly matches the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch normalize-test-include-paths

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit 83c9d46 into master Apr 18, 2026
3 of 5 checks passed
@zackees
zackees deleted the normalize-test-include-paths branch August 30, 2026 22:22
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