From 40f703df0ccaec9f2c387fa500ca1a3e91e31501 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 2 Oct 2026 21:42:47 +0800 Subject: [PATCH] Keep the Added Test Includes Below the NOMINMAX Guard test_marchingsquares.cpp and test_texture_displacement.cpp had includes inside #ifndef NOMINMAX, which the tests inherit as defined on Windows from libslic3r, so those were skipped there. .clang-tidy also ignores the MSVC STL and UCRT internals, Boost.Multiprecision's fwd.hpp and CPython's Windows include directory, as in #16068. --- .clang-tidy | 10 ++++++++-- tests/libslic3r/test_marchingsquares.cpp | 3 ++- tests/libslic3r/test_texture_displacement.cpp | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 381829cf3a..f45561badb 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -7,8 +7,10 @@ CheckOptions: misc-include-cleaner.UnusedIncludes: false # Headers that declare a symbol but are not the one to include: per-platform # implementations of wxWidgets and Boost.Thread (a Linux run would suggest the - # GTK or pthread one), library internals and forward declarations, CPython's - # headers behind Python.h, curl's behind curl.h, oneTBB's behind tbb/, and + # GTK or pthread one), library internals and forward declarations (MSVC's STL + # __msvc_* and the Windows UCRT's corecrt_* included), CPython's headers behind + # Python.h (python3.x/ on Linux and macOS, libpython/include/ on Windows), + # curl's behind curl.h, oneTBB's behind tbb/, and # admesh's stl.h, which the include path also exposes without its directory. # Clipper's own clipper.hpp is only included through libslic3r/clipper.hpp or # clipper_z.hpp, which configure it first, and Boost.Polygon's headers only @@ -27,7 +29,11 @@ CheckOptions: .*[/\\]impl[/\\].*; .*_fwd\.hpp; python3\.[0-9]+[/\\].*; + libpython[/\\]include[/\\].*; bits[/\\].*; + corecrt_.*\.h; + __msvc_.*\.hpp; + boost[/\\]multiprecision[/\\]fwd\.hpp; imconfig\.h; expat_external\.h; admesh[/\\]stl\.h; diff --git a/tests/libslic3r/test_marchingsquares.cpp b/tests/libslic3r/test_marchingsquares.cpp index ed9f056650..e9d0f8ebc2 100644 --- a/tests/libslic3r/test_marchingsquares.cpp +++ b/tests/libslic3r/test_marchingsquares.cpp @@ -1,5 +1,7 @@ #ifndef NOMINMAX #define NOMINMAX +#endif + #include "libslic3r/Point.hpp" #include #include "libslic3r/libslic3r.h" @@ -21,7 +23,6 @@ #include "libslic3r/TriangleMesh.hpp" #include #include -#endif #include #include "test_utils.hpp" diff --git a/tests/libslic3r/test_texture_displacement.cpp b/tests/libslic3r/test_texture_displacement.cpp index 165529d823..1d9a89481b 100644 --- a/tests/libslic3r/test_texture_displacement.cpp +++ b/tests/libslic3r/test_texture_displacement.cpp @@ -1,5 +1,7 @@ #ifndef NOMINMAX #define NOMINMAX +#endif + #include #include #include @@ -22,7 +24,6 @@ #include #include "libslic3r/libslic3r.h" #include -#endif #include #include