Benchmarks and examples are not in the tests build, so removing an API breaks them silently
PitfallVerified 29 Sep 2026Holds project: dftracer-utils
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
After scan::duql was removed, the tests build passed, but view_api_bench still called the removed function and no longer built.
Cause#
The tests build does not compile benchmarks/ or examples/, so nothing there is checked when an API changes.
Fix#
After removing or renaming an API, grep benchmarks/ and examples/ for callers, or build the release bench and example targets before you commit.
Evidence#
dftracer-utils stage 12b, 2026-09-28: the stale call in view_api_bench was found only when the benchmark was built; every bench and example caller was then fixed.
Also found by searching
- view_api_bench: error: no member named 'duql' in namespace 'scan' after tests build passed
- I removed an API, all tests compiled, but a benchmark broke later
- how do I make sure benchmarks and examples still compile after renaming or removing a function
- tests target does not build benchmarks/ or examples/, grep callers or build bench targets before commit
- tests build passed but view_api_bench no longer compiles after I removed a function
- error: no member named 'duql' in namespace scan, only in benchmarks
- how do I find callers of a removed API in benchmarks and examples that ctest doesn't build
- renamed C++ API, examples and bench targets not part of tests preset, breakage found late