Summary
Add a tests/ directory with input headers and golden outputs that exercise the AST visitor across every documented transform path. Wire each fixture into CTest. Target: 94% line coverage as measured by the lcov pipeline introduced in PR #11.
Background
The tool today has no automated tests. PR #11 adds the lcov + Codecov v5 plumbing but reports against an empty test surface, which makes the coverage metric meaningless. This issue populates the surface.
Fixtures are derived directly from the cases enumerated in the project README.
Scope
Fixtures
Golden outputs
CMake / CTest
Acceptance criteria
- 8 fixture + golden pairs committed.
- All 13 CI cells run the new CTest fixtures and pass.
- Codecov report after merge shows ≥ 94% line coverage on
src/. If the first measurement falls short, PR body documents which AST branches remain uncovered and proposes either (a) additional fixtures or (b) an explicit .codecov.yml ignore list for genuinely unreachable defensive paths.
Dependencies
Conventions
- Branch: cut from
staging, named <N>-test-add-transform-fixture-pack.
- Commits:
[#<N>]:svarga:test, <description>.
- PR: targets
staging, title [#<N>]:svarga:test, add transform fixture pack for coverage.
Summary
Add a
tests/directory with input headers and golden outputs that exercise the AST visitor across every documented transform path. Wire each fixture into CTest. Target: 94% line coverage as measured by the lcov pipeline introduced in PR #11.Background
The tool today has no automated tests. PR #11 adds the lcov + Codecov v5 plumbing but reports against an empty test surface, which makes the coverage metric meaningless. This issue populates the surface.
Fixtures are derived directly from the cases enumerated in the project README.
Scope
Fixtures
tests/fixtures/primitives.hpp— single POD with all C primitive types (README'stypecheck::Record).tests/fixtures/typedef.hpp— typedef'd primitives (MyUInt-style).tests/fixtures/nested-ns.hpp— POD inside nested namespace.tests/fixtures/embedded-pod.hpp— POD with embedded POD-array fields.tests/fixtures/array-of-arrays.hpp— 2D POD array field (README'sfield_05[3][8]).tests/fixtures/ignored-non-pod.hpp— member of typestd::string/std::vector; must be skipped.tests/fixtures/unreferenced.hpp— struct never referenced byh5::read|h5::write|h5::create; must be ignored.tests/fixtures/topological.hpp— three POD types referencing each other in mixed declaration order; output must be topologically sorted.Golden outputs
tests/golden/<name>.hpp.expectedper fixture. Committed verbatim; reviewed by hand on first pass.CMake / CTest
tests/CMakeLists.txtadds one CTest per fixture: runs$<TARGET_FILE:h5cpp>on the fixture → diffs output against golden → fails on non-empty diff.CMakeLists.txtcallsenable_testing()andadd_subdirectory(tests).cmake -E compare_filesfor portable diff.Acceptance criteria
src/. If the first measurement falls short, PR body documents which AST branches remain uncovered and proposes either (a) additional fixtures or (b) an explicit.codecov.ymlignore list for genuinely unreachable defensive paths.Dependencies
Conventions
staging, named<N>-test-add-transform-fixture-pack.[#<N>]:svarga:test, <description>.staging, title[#<N>]:svarga:test, add transform fixture pack for coverage.