Skip to content

test: densify ctest suite — line coverage 86.4% → 93.1% (tests-only)#30

Merged
luisleo526 merged 2 commits into
mainfrom
tests/ctest-densification
Jun 4, 2026
Merged

test: densify ctest suite — line coverage 86.4% → 93.1% (tests-only)#30
luisleo526 merged 2 commits into
mainfrom
tests/ctest-densification

Conversation

@luisleo526
Copy link
Copy Markdown
Collaborator

Summary

Densifies the ctest unit suite so passing it more strongly underwrites "~95% of pinescript reproduced." Tests + coverage-tooling only — zero src//include/ changes.

  • ctest: 53 → 68 unit tests, 100% pass under the canonical Release (-DNDEBUG) gate.
  • Line coverage: 86.38% → 93.06% (+6.68 pts, 499 fewer missed lines).
  • TV corpus parity unchanged (245 excellent + 1 anomaly, no drift).

15 new tests target the lowest-covered translation units, pinning real Pine-correct behavior via closed-form OHLC oracles and na/warmup edge cases.

Per-TU line coverage

TU before after
c_abi 16% 100%
engine_report 73% 100%
ta_moving_averages 93% 100%
ta_extremes_volume 95% 99%
ta_oscillators 95% 99%
ta_volatility_trend 94% 97%
engine_strategy_commands 92% 96%
engine_fills 94% 96%
engine_lower_tf 88% 95%
engine_path_resolve 78% 94%
engine_run 79% 93%
engine_security 86% 93%
matrix 88% 98%
timeframe 89% 94%
session_time 68% 90%

NDEBUG-proof tests

The prescribed gate builds Release (-DNDEBUG), which no-ops bare assert() and makes assert-only tests pass vacuously. All new tests use a self-rolled CHECK + failure-counter return instead; non-vacuity was confirmed by corrupt-and-rebuild. (Note: the pre-existing test_security_tf_validation.cpp has this latent assert()/NDEBUG defect — flagged, out of scope here.)

Coverage tooling (scripts/)

  • coverage.sh: fix uncovered.txt sort key (was sorting by region cov col 4, now line cov col 10); capture llvm-cov's "N functions have mismatched data" warning — benign (header inline/template code instantiated across all test binaries with differing mapping hashes; the merge drops unmatched variants) — and replace it with a plain-language NOTE.
  • cov_union.py: on-demand per-binary union verifier for exact header line coverage (recovers the multi-binary undercount, e.g. generic_matrix.hpp ~77% reported → ~86% true). .cpp headline metric unchanged.

Verification

  • ctest 68/68 pass (Release).
  • scripts/run_corpus.sh parity unchanged.
  • No src/ or include/ diffs.

🤖 Generated with Claude Code

luisleo526 and others added 2 commits June 5, 2026 04:15
…union verifier

- coverage.sh: fix uncovered.txt sort key (region-cov col 4 -> line-cov col 10).
- coverage.sh: capture llvm-cov's "N functions have mismatched data" warning
  (benign: header inline/template code instantiated across all test binaries
  with differing mapping hashes; the merge drops unmatched variants) and replace
  it with a plain-language NOTE in totals.txt; silence duplicate emissions.
- cov_union.py: on-demand per-binary union verifier for exact header line
  coverage (recovers the multi-binary undercount, e.g. generic_matrix.hpp
  ~77% reported -> ~86% true). .cpp metric unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add 15 unit tests targeting the lowest-covered translation units, raising
line coverage from 86.38% to 93.06% (499 fewer missed lines). ctest 53 -> 68,
all pass under the canonical Release (-DNDEBUG) gate. No src/ or include/
changes; TV corpus parity unchanged (245 excellent + 1 anomaly).

All tests are NDEBUG-proof (self-rolled CHECK + failure-counter return, not
bare assert() which the Release gate would no-op) and pin real Pine-correct
behavior via closed-form OHLC oracles / na+warmup edges.

New per-TU coverage:
  engine_report 73->100, session_time 68->90, engine_run 79->93,
  engine_path_resolve 78->94, engine_security 86->93, matrix 88->98,
  timeframe 89->94, c_abi 16->100, ta_moving_averages 93->100,
  ta_extremes_volume 95->99, ta_oscillators 95->99, ta_volatility_trend 94->97,
  engine_strategy_commands 92->96, engine_fills 94->96, engine_lower_tf 88->95.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@luisleo526 luisleo526 merged commit 7fb78c1 into main Jun 4, 2026
5 checks passed
@luisleo526 luisleo526 deleted the tests/ctest-densification branch June 4, 2026 20:18
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