Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #525 +/- ##
==========================================
- Coverage 95.90% 93.05% -2.85%
==========================================
Files 11 10 -1
Lines 927 547 -380
Branches 30 30
==========================================
- Hits 889 509 -380
Misses 28 28
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7986d94 to
9f9acd0
Compare
Replace the 2,269-line hand-maintained xyz/detail/operator_thunks.hh with scripts/generate_operator_thunks.py (--output <path>), generating all 38 overloadable member operator thunks and overload sets at build time: - Bazel: add rules_python (Python 3.13 toolchain), py_binary, and genrule producing xyz/detail/operator_thunks.hh. - CMake: find Python3::Interpreter, generate operator_thunks.hh into <build>/generated/xyz/detail/operator_thunks.hh via a separate generated_headers FILE_SET, and install it with the protocol target. - Consteval coverage: emit operator_thunks.hh into the probe work directory (uninstrumented, as it has no consteval code) so test translation units including xyz/protocol.hh compile. - CI: add scripts/generate_operator_thunks.py to the path filters for Bazel, CMake, sanitizers, clang-tidy, and coverage workflows. Read generated headers from CMake build tree in consteval_coverage.py Fix multi-line docstring formatting in scripts/generate_operator_thunks.py
9f9acd0 to
2d83caa
Compare
| find_package(ClangTidy) | ||
| find_package(Python3 REQUIRED COMPONENTS Interpreter) | ||
|
|
||
| set(XYZ_PROTOCOL_GENERATED_INCLUDE_DIRECTORY |
There was a problem hiding this comment.
The operator thunks are no longer measured: the generated header lands in the build tree, outside the repository, so Codecov drops it. A thunk that loses its test, including the ref-qualified ones the #524 follow-ups will add through this generator, will no longer show as uncovered. Checking in the generated header, with a CI step that regenerates it and fails on any diff, would keep the measurement and keep the thunks searchable and reviewable. It would also spare CMake users a Python dependency. Your call whether that is worth it.
There was a problem hiding this comment.
This feels like a simpler and cleaner approach. I’ll amend the PR.
| include(xyz_add_object_library) | ||
|
|
||
| find_package(ClangTidy) | ||
| find_package(Python3 REQUIRED COMPONENTS Interpreter) |
There was a problem hiding this comment.
The generator needs Python 3.9 or later (tuple[...] in a module-level annotation), but this accepts any Python 3, so an older one fails at build time with a traceback. find_package(Python3 3.9 REQUIRED COMPONENTS Interpreter) makes it a configure error instead.
There was a problem hiding this comment.
Agreed. Re-work suggested above will render this moot.
Replace the 2k+-line xyz/detail/operator_thunks.hh with a generated version.
We cannot use reflection to generate the thunks and prefer a custom build step to a macro (barely).