Two complementary improvements aimed at reducing recurring maintenance
overhead:
1. **Test-count centralisation** — `doc/api/tests.md` is now the
single source of truth for the test counts. All other docs
(README, CLAUDE.md, doc/contributing.md, doc/getting-started.md,
doc/math/validation.md, doc/math/validation-protocol.md,
scripts/try_it.sh) use qualitative phrasing + a link instead of
hardcoded numbers. The previous regime had eight places with
"227 CGAL tests, 23 non-CGAL tests" that drifted apart across
releases (the v0.9.0 release-prep needed to touch nine files).
2. **Versioning policy** — `doc/release-policy.md` (new, ~250 lines)
formalises:
* SemVer rules for the pre-1.0 and post-1.0 phases.
* Phase-milestone → MINOR-bump mapping (v0.10.0 → Phase 9c, …).
* Single-source-of-truth table for moving numbers (test counts,
version, date).
* Step-by-step release process (the recipe that worked for v0.9.0
after the false-start with PR #11/#12).
* Hotfix policy + post-1.0 deprecation policy.
* Known failure modes and how to recover from them.
Plus a small CI gate:
3. **scripts/check-test-counts.sh** — verifies the totals in
doc/api/tests.md match `ctest` output. Re-uses existing build-cgal/
if present. Exit 0 on match, 1 on divergence with recovery hints.
Cheap enough (~30 s) to run on every PR.
Other cleanups
──────────────
* code/tests/cgal/CMakeLists.txt — stale "Test 7 (genus-2 homology)
as GTEST_SKIP stub until Phase 8" comment removed; that test landed
as HomologyGenerators.Genus2_FourCutEdges in Phase 7.
* CLAUDE.md — "test-fast also runs stubs" Known Quirks entry updated
to reflect the v0.9.0 stub cleanup (no GTEST_SKIPs remain).
* CLAUDE.md doc map — new entry for doc/release-policy.md.
Stubs audit
───────────
Zero GTEST_SKIP() calls remain in the codebase as of this commit.
The only references to stubs are in historical documentation
(CHANGELOG.md v0.7.0 entry, doc/roadmap/* "deferred to research-track"
notes) — those are intended.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
126 lines
5.9 KiB
CMake
126 lines
5.9 KiB
CMake
# tests/cgal/CMakeLists.txt
|
||
#
|
||
# CGAL-dependent test target. Only built when -DWITH_CGAL=ON.
|
||
# Requires Boost (find_package(Boost REQUIRED) is called in the root CMakeLists).
|
||
#
|
||
# Run with:
|
||
# cmake -S code -B build -DWITH_CGAL=ON
|
||
# cmake --build build --target conformallab_cgal_tests
|
||
# ctest --test-dir build -R cgal
|
||
|
||
add_executable(conformallab_cgal_tests
|
||
# ── Phase 3a: mesh infrastructure ──────────────────────────────────────
|
||
test_conformal_mesh.cpp
|
||
|
||
# ── Phase 3b: HyperIdealFunctional ─────────────────────────────────────
|
||
test_hyper_ideal_functional.cpp
|
||
|
||
# ── Phase 3c + 3e: SphericalFunctional + gauge-fix ────────────────────
|
||
test_spherical_functional.cpp
|
||
|
||
# ── Phase 3d: EuclideanCyclicFunctional ───────────────────────────────
|
||
test_euclidean_functional.cpp
|
||
|
||
# ── Phase 3f: Hessians (cotangent Laplacian, spherical + Euclidean) ───
|
||
test_euclidean_hessian.cpp
|
||
test_spherical_hessian.cpp
|
||
|
||
# ── Phase 9b: Hyper-ideal Hessian — block-FD vs full-FD validation ───
|
||
# Verifies the O(F·36) block-local Hessian agrees with the
|
||
# O(F·n) full-FD baseline. Java upstream has no Hessian at all
|
||
# (HyperIdealFunctional.hasHessian() returns false) — both
|
||
# variants are conformallab++ extensions beyond the port.
|
||
test_hyper_ideal_hessian.cpp
|
||
|
||
# ── Phase 4a: Newton solver ────────────────────────────────────────────
|
||
test_newton_solver.cpp
|
||
|
||
# ── Phase 4b: Mesh I/O (CGAL::IO) ─────────────────────────────────────
|
||
test_mesh_io.cpp
|
||
|
||
# ── Phase 4c: End-to-end pipeline + user examples ─────────────────────
|
||
test_pipeline.cpp
|
||
|
||
# ── Phase 5: Layout / embedding + serialization ────────────────────────
|
||
test_layout.cpp
|
||
|
||
# ── Phase 6: Gauss–Bonnet, cut graph, exact trilateration, normalisation
|
||
test_phase6.cpp
|
||
|
||
# ── Phase 7: Java-parity layout — MobiusMap, priority BFS, halfedge_uv,
|
||
# period matrix, fundamental domain, tiling
|
||
test_phase7.cpp
|
||
|
||
# ── Java parity: geometry utility tests ──────────────────────────────────
|
||
# Ported from CuttinUtilityTest, UnwrapUtilityTest,
|
||
# ConvergenceUtilityTests, HomologyTest. All tests active —
|
||
# the v0.7.0 genus-2 homology stub was implemented in Phase 7
|
||
# (HomologyGenerators.Genus2_FourCutEdges, brezel2.obj).
|
||
test_geometry_utils.cpp
|
||
|
||
# ── Scalability smoke tests ────────────────────────────────────────────────
|
||
# Newton convergence on large real-world meshes (cathead, brezel, brezel2).
|
||
# Assert correctness only (< 30 iterations, ||G|| < 1e-8).
|
||
# Wall-clock time is printed for documentation but NOT asserted,
|
||
# so the tests remain stable on slow CI hardware (Raspberry Pi ARM64).
|
||
test_scalability_smoke.cpp
|
||
|
||
# ── Phase 8 MVP: new CGAL-style public API ────────────────────────────────
|
||
# First client of Conformal_map_traits.h + Discrete_conformal_map.h.
|
||
# Acceptance probe before Phase 9a (Inversive-Distance) lands.
|
||
test_cgal_traits_mvp.cpp
|
||
|
||
# ── Phase 9a.1: CPEuclideanFunctional (BPS 2010 circle packing) ──────────
|
||
# Face-based circle-packing functional ported from
|
||
# CPEuclideanFunctional.java. Reference: Bobenko-Pinkall-Springborn 2010.
|
||
test_cp_euclidean_functional.cpp
|
||
|
||
# ── Phase 9a.2: InversiveDistance (Luo 2004 + Glickenstein 2011) ─────────
|
||
# Vertex-based inversive-distance circle-packing functional. No Java
|
||
# reference; implemented from the literature. Cross-validated against
|
||
# EuclideanCyclicFunctional at the natural initial geometry (u = 0).
|
||
test_inversive_distance_functional.cpp
|
||
|
||
# ── Phase 9a: Newton solvers for the two new circle-packing functionals ──
|
||
# Convergence tests for newton_cp_euclidean (analytic Hessian) and
|
||
# newton_inversive_distance (FD Hessian).
|
||
test_newton_phase9a.cpp
|
||
|
||
# ── Phase 8b-Lite: CGAL entry wrappers for the 4 non-Euclidean modes ─────
|
||
# Spherical, HyperIdeal, CircleP-Euclidean, Inversive-Distance via
|
||
# <CGAL/Discrete_*.h> public API + Conformal_layout.h wrapper.
|
||
test_cgal_phase8b_lite.cpp
|
||
)
|
||
|
||
target_include_directories(conformallab_cgal_tests SYSTEM PRIVATE
|
||
${CMAKE_SOURCE_DIR}/deps/eigen-3.4.0
|
||
${CMAKE_SOURCE_DIR}/deps/CGAL-6.1.1/include
|
||
${CMAKE_SOURCE_DIR}/deps/single_includes
|
||
${Boost_INCLUDE_DIRS}
|
||
)
|
||
|
||
target_include_directories(conformallab_cgal_tests PRIVATE
|
||
${CMAKE_SOURCE_DIR}/include
|
||
)
|
||
|
||
target_compile_definitions(conformallab_cgal_tests PRIVATE
|
||
CGAL_DISABLE_GMP
|
||
CGAL_DISABLE_MPFR
|
||
# Data directory — absolute path to code/data/ at build time.
|
||
# Used by tests that load real mesh files (cathead.obj, brezel2.obj, …).
|
||
CONFORMALLAB_DATA_DIR="${CMAKE_SOURCE_DIR}/data"
|
||
)
|
||
|
||
# Suppress warnings from CGAL/Boost headers
|
||
target_compile_options(conformallab_cgal_tests PRIVATE
|
||
$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-Wno-unused-parameter>
|
||
)
|
||
|
||
target_link_libraries(conformallab_cgal_tests PRIVATE GTest::gtest_main)
|
||
|
||
include(GoogleTest)
|
||
gtest_discover_tests(conformallab_cgal_tests
|
||
TEST_PREFIX "cgal."
|
||
DISCOVERY_TIMEOUT 60
|
||
)
|