Make test options dependent on ZLIB_ENABLE_TESTS#1933
Conversation
WalkthroughThe CMake configuration was updated to introduce a new top-level option, Changes
Suggested labels
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CMakeLists.txt (1)
50-57: Dependency chain looks solid; consider exposingWITH_BENCHMARK_APPSin the CXX-enable guard for completenessThe new
cmake_dependent_optionstatements correctly gate all test-related knobs behindZLIB_ENABLE_TESTS, eliminating the spurious C++ compiler probe when tests are disabled – nice fix.One tiny polish item:
WITH_BENCHMARK_APPScan only becomeONwhenWITH_BENCHMARKSis alsoON, but it might still be worth including it in the guard that decides whether to callenable_language(CXX)(line 58) for symmetry with the feature list below. This keeps the intent obvious if someone ever relaxes that dependency later.- if(WITH_GTEST OR WITH_FUZZERS OR WITH_BENCHMARKS) + if(WITH_GTEST OR WITH_FUZZERS OR WITH_BENCHMARKS OR WITH_BENCHMARK_APPS) enable_language(CXX) endif()No functional change today, just a future-proof touch.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
CMakeLists.txt(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: pps83
PR: zlib-ng/zlib-ng#0
File: :0-0
Timestamp: 2025-01-13T18:28:11.751Z
Learning: In zlib-ng, removing preprocessor guards (like HAVE_*) should be described as removing unused conditional compilation checks rather than removing functionality, as the underlying implementation often remains intact.
Learnt from: mtl1979
PR: zlib-ng/zlib-ng#1925
File: arch/loongarch/lasxintrin_ext.h:38-65
Timestamp: 2025-07-04T16:59:44.683Z
Learning: In zlib-ng, the policy for supporting old compilers is to maintain compatibility for up to two years after GitHub removes support for them in CI, or when there is no long-time contributor left testing for the architecture if the architecture was not supported by GitHub Actions at all.
Learnt from: mtl1979
PR: zlib-ng/zlib-ng#1904
File: arch/riscv/Makefile.in:12-14
Timestamp: 2025-04-15T09:20:52.333Z
Learning: Optional feature flags in Makefile.in templates should default to empty strings. The configure script should detect feature support and update these variables accordingly during the configuration process.
CMakeLists.txt (4)
Learnt from: pps83
PR: zlib-ng/zlib-ng#0
File: :0-0
Timestamp: 2025-01-13T18:28:11.751Z
Learning: In zlib-ng, removing preprocessor guards (like HAVE_*) should be described as removing unused conditional compilation checks rather than removing functionality, as the underlying implementation often remains intact.
Learnt from: mtl1979
PR: zlib-ng/zlib-ng#1925
File: arch/loongarch/lasxintrin_ext.h:38-65
Timestamp: 2025-07-04T16:59:44.683Z
Learning: In zlib-ng, the policy for supporting old compilers is to maintain compatibility for up to two years after GitHub removes support for them in CI, or when there is no long-time contributor left testing for the architecture if the architecture was not supported by GitHub Actions at all.
Learnt from: mtl1979
PR: zlib-ng/zlib-ng#1904
File: arch/riscv/Makefile.in:12-14
Timestamp: 2025-04-15T09:20:52.333Z
Learning: Optional feature flags in Makefile.in templates should default to empty strings. The configure script should detect feature support and update these variables accordingly during the configuration process.
Learnt from: KungFuJesus
PR: zlib-ng/zlib-ng#1872
File: arch/x86/chorba_sse2.c:0-0
Timestamp: 2025-02-18T02:53:23.621Z
Learning: In zlib-ng, when macro names and parameters are self-explanatory and scalar versions of the code provide context, additional documentation for the macros may not be necessary.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (60)
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
- GitHub Check: Windows GCC Native Instructions (AVX)
- GitHub Check: macOS Clang Native Instructions (ARM64)
- GitHub Check: Windows MSVC 2022 v142 Win32
- GitHub Check: EL9 Clang S390X DFLTCC MSAN
- GitHub Check: Ubuntu GCC Native Instructions (AVX)
- GitHub Check: macOS GCC Symbol Prefix
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1933 +/- ##
============================================
+ Coverage 39.39% 81.66% +42.27%
============================================
Files 74 150 +76
Lines 7885 13618 +5733
Branches 1303 3052 +1749
============================================
+ Hits 3106 11121 +8015
+ Misses 4536 1521 -3015
- Partials 243 976 +733 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Previously, building with
-DZLIB_ENABLE_TESTS=OFFwould still check for a C++ compiler unless-DWITH_GTEST=OFFwas also supplied, even though it wouldn't be used.Summary by CodeRabbit