fix(ci): decouple CGAL tests from viewer — add WITH_CGAL_TESTS flag
Some checks failed
C++ Tests / test-fast (push) Successful in 2m12s
Mirror to Codeberg / mirror (push) Failing after 1s
C++ Tests / test-cgal (push) Failing after 1m52s

Root cause: -DWITH_CGAL=ON implied -DWITH_VIEWER=ON, which pulled in
GLFW, which requires wayland-scanner — not present in the headless CI
container (ubuntu:22.04 ARM64).

Fix: new CMake option -DWITH_CGAL_TESTS=ON builds conformallab_cgal_tests
without touching the viewer, GLFW, libigl, or any display dependency.
Only Boost headers are required (already in the Docker image).

Changes
───────
code/CMakeLists.txt
  - Add WITH_CGAL_TESTS option (OFF by default)
  - find_package(Boost REQUIRED) now shared between WITH_CGAL and WITH_CGAL_TESTS
  - WITH_CGAL still implies WITH_VIEWER (for local full builds)
  - Remove duplicate find_package(Boost) inside the WITH_CGAL block

code/tests/CMakeLists.txt
  - cgal/ subdirectory added for WITH_CGAL OR WITH_CGAL_TESTS

.gitea/workflows/cpp-tests.yml
  - test-cgal job: -DWITH_CGAL=ON → -DWITH_CGAL_TESTS=ON

README.md
  - Build modes table: three rows (default / CGAL_TESTS / CGAL full)
  - Quick-start: separate headless and full-local sections
  - Prerequisite table updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-05-14 13:50:56 +02:00
parent 78d13bf561
commit 6886803a29
4 changed files with 56 additions and 32 deletions

View File

@@ -191,13 +191,16 @@ if (used_fallback)
## Build-Modi
| Modus | CMake-Flags | Was wird gebaut |
|-------|------------|-----------------|
| **Nur Tests** (Standard) | *(keine)* | `conformallab_tests`Eigen + GTest |
| **CGAL-Tests + Beispiele** | `-DWITH_CGAL=ON` | `conformallab_cgal_tests`, Beispiel-Programme, CLI |
| **Interaktiver Viewer** | `-DWITH_CGAL=ON` | + `example_viewer`, Viewer in CLI integriert |
| Modus | CMake-Flags | Was wird gebaut | System-Deps |
|-------|------------|-----------------|-------------|
| **Nur Tests** (Standard / CI fast) | *(keine)* | `conformallab_tests`36 Tests | keine |
| **CGAL-Tests headless** (CI full) | `-DWITH_CGAL_TESTS=ON` | `conformallab_cgal_tests` — 158 Tests | Boost |
| **Vollständig** (lokal mit Viewer) | `-DWITH_CGAL=ON` | + CLI, Beispiel-Programme, interaktiver Viewer | Boost + Wayland/X11 |
Externe Abhängigkeiten sind als Tarballs in `code/deps/tarballs/` enthalten und werden beim CMake-Configure-Schritt extrahiert (GTest via `FetchContent`). **Boost** wird nur mit `-DWITH_CGAL=ON` benötigt (Header-Only durch CGAL 6.x).
**`-DWITH_CGAL_TESTS=ON`** ist der empfohlene CI-Modus: kein GLFW, kein wayland-scanner, kein Display benötigt.
**`-DWITH_CGAL=ON`** aktiviert automatisch den Viewer — nur für lokale Entwicklung mit Display.
Externe Abhängigkeiten sind als Tarballs in `code/deps/tarballs/` enthalten und werden beim CMake-Configure-Schritt extrahiert (GTest via `FetchContent`). **Boost** wird nur mit `-DWITH_CGAL_TESTS=ON` oder `-DWITH_CGAL=ON` benötigt (Header-Only durch CGAL 6.x).
---
@@ -207,7 +210,7 @@ Externe Abhängigkeiten sind als Tarballs in `code/deps/tarballs/` enthalten und
|------|---------|
| C++ Compiler (GCC oder Clang) | C++17 |
| CMake | 3.20 |
| Boost Headers | 1.70 *(nur mit `-DWITH_CGAL=ON`)* |
| Boost Headers | 1.70 *(nur mit `-DWITH_CGAL_TESTS=ON` oder `-DWITH_CGAL=ON`)* |
---
@@ -226,24 +229,27 @@ cmake --build build --target conformallab_tests -j$(nproc)
ctest --test-dir build --output-on-failure
```
### CGAL-Tests + Beispiele (benötigt System-Boost)
### CGAL-Tests headless (CI — kein Display, kein wayland-scanner)
```bash
cmake -S code -B build -DWITH_CGAL=ON
cmake --build build -j$(nproc)
# benötigt: apt install libboost-dev (Ubuntu) / brew install boost (macOS)
cmake -S code -B build -DWITH_CGAL_TESTS=ON
cmake --build build --target conformallab_cgal_tests -j$(nproc)
ctest --test-dir build -R "^cgal\." --output-on-failure
./build/examples/example_layout
./bin/conformallab_core -i input.off -g euclidean -o layout.off
```
Erwartet: **158 Tests bestanden, 2 skipped** (die zwei `@Ignore`-Hessian-Stubs).
### Interaktiver Viewer
### Vollständig lokal (CLI + Beispiele + interaktiver Viewer)
```bash
# benötigt zusätzlich: Wayland/X11 dev-Pakete (wayland-scanner, libx11-dev …)
cmake -S code -B build -DWITH_CGAL=ON
cmake --build build -t example_viewer -j$(nproc)
cmake --build build -j$(nproc)
ctest --test-dir build -R "^cgal\." --output-on-failure
./build/examples/example_layout
./build/examples/example_viewer data/off/example.off
./bin/conformallab_core -i input.off -g euclidean -o layout.off
```
---
@@ -339,7 +345,7 @@ code/
Reine Mathe-Tests, nur Eigen: Clausen / Lobachevsky / ImLi₂, Hyper-ideal Geometrie, Tetraeder-Volumina.
### `conformallab_cgal_tests` (lokal — `-DWITH_CGAL=ON`)
### `conformallab_cgal_tests` (`-DWITH_CGAL_TESTS=ON` headless / `-DWITH_CGAL=ON` voll)
| Suite | Tests | Was geprüft wird |
|-------|------:|-----------------|