ifcviewer: add tier-1 unit tests (Catch2 + CTest)

Covers the pure-logic modules with no Qt event loop or GL context: BVH
build, LOD decimation, sidecar round-trip, instanced-geometry layout
constants, and Federation save/load + relative-path policy. Each test
binary compiles only the production source(s) under test, so the unit
tier doesn't pull Qt/OpenCASCADE/IfcGeom into the test build.

Gated behind BUILD_IFCVIEWER_TESTS=OFF; default builds remain offline.
Catch2 v3.5.4 is fetched on demand via FetchContent.
This commit is contained in:
Dion Moult
2026-04-28 21:49:44 +10:00
parent 633c613da2
commit e21bd1ac96
10 changed files with 1145 additions and 0 deletions
+4
View File
@@ -70,3 +70,7 @@ install(TARGETS IfcViewer EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
install(FILES ${IFCVIEWER_H_FILES}
DESTINATION ${INCLUDEDIR}/ifcviewer
)
if(BUILD_IFCVIEWER_TESTS)
add_subdirectory(tests)
endif()