From b305e8b154065770ea0cc12c6d6e10fac54a9f1d Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Wed, 12 Aug 2026 18:00:48 +0200 Subject: [PATCH] tests: compile the five CAD test files that were never wired MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tests/libslic3r/CMakeLists.txt added only test_caddocument.cpp under SLIC3R_CAD. The other five shipped in the tree and were never compiled, so 49 TEST_CASE blocks looked like coverage and were not: sketch constraints, sketch editing, sketch import, inference, and the libslvs constraint set. They also still targeted Catch2 v2 — mainline is on v3, where the umbrella header is catch2/catch_all.hpp and Approx lives in the Catch namespace rather than at global scope. Both fixed; nothing else in the files changed. Found by building the tree rather than reading it. Suite goes from 374 to 423 test cases, 54,424 to 54,620 assertions, all passing. Co-Authored-By: Claude Opus 5 (1M context) --- tests/libslic3r/CMakeLists.txt | 8 +++++++- tests/libslic3r/test_sketchconstraints.cpp | 2 +- tests/libslic3r/test_sketchedit.cpp | 2 +- tests/libslic3r/test_sketchimport.cpp | 2 +- tests/libslic3r/test_sketchinference.cpp | 3 ++- tests/libslic3r/test_slvs_constraints.cpp | 3 ++- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/libslic3r/CMakeLists.txt b/tests/libslic3r/CMakeLists.txt index 7aa1a46969..220a3fa256 100644 --- a/tests/libslic3r/CMakeLists.txt +++ b/tests/libslic3r/CMakeLists.txt @@ -38,7 +38,13 @@ add_executable(${_TEST_NAME}_tests ) if (SLIC3R_CAD) - target_sources(${_TEST_NAME}_tests PRIVATE test_caddocument.cpp) + target_sources(${_TEST_NAME}_tests PRIVATE + test_caddocument.cpp + test_sketchconstraints.cpp + test_sketchedit.cpp + test_sketchimport.cpp + test_sketchinference.cpp + test_slvs_constraints.cpp) endif () if (TARGET OpenVDB::openvdb) diff --git a/tests/libslic3r/test_sketchconstraints.cpp b/tests/libslic3r/test_sketchconstraints.cpp index 64ffd5fd3b..eb54540fee 100644 --- a/tests/libslic3r/test_sketchconstraints.cpp +++ b/tests/libslic3r/test_sketchconstraints.cpp @@ -1,4 +1,4 @@ -#include +#include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) #include "libslic3r/SketchConstraints.hpp" using namespace Slic3r; diff --git a/tests/libslic3r/test_sketchedit.cpp b/tests/libslic3r/test_sketchedit.cpp index a0193445d5..6b65c8201b 100644 --- a/tests/libslic3r/test_sketchedit.cpp +++ b/tests/libslic3r/test_sketchedit.cpp @@ -1,4 +1,4 @@ -#include +#include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) #include "libslic3r/SketchEngine.hpp" #include diff --git a/tests/libslic3r/test_sketchimport.cpp b/tests/libslic3r/test_sketchimport.cpp index ad58ca4706..79c932c5b3 100644 --- a/tests/libslic3r/test_sketchimport.cpp +++ b/tests/libslic3r/test_sketchimport.cpp @@ -1,4 +1,4 @@ -#include +#include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) #include "libslic3r/SketchImport.hpp" #include "libslic3r/Utils.hpp" // resources_dir diff --git a/tests/libslic3r/test_sketchinference.cpp b/tests/libslic3r/test_sketchinference.cpp index d2ea35cf14..62b95940cd 100644 --- a/tests/libslic3r/test_sketchinference.cpp +++ b/tests/libslic3r/test_sketchinference.cpp @@ -1,4 +1,5 @@ -#include +#include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) +using Catch::Approx; // v3 scopes Approx into the Catch namespace; v2 had it at global scope #include "libslic3r/SketchInference.hpp" diff --git a/tests/libslic3r/test_slvs_constraints.cpp b/tests/libslic3r/test_slvs_constraints.cpp index e6044e6bfc..07a4bcffd6 100644 --- a/tests/libslic3r/test_slvs_constraints.cpp +++ b/tests/libslic3r/test_slvs_constraints.cpp @@ -1,4 +1,5 @@ -#include +#include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) +using Catch::Approx; // v3 scopes Approx into the Catch namespace; v2 had it at global scope #include "libslic3r/SketchSolver.hpp" #include "libslic3r/SketchEngine.hpp"