Add ExtraTest for CATCH_CONFIG_FAST_COMPILE#3100
Open
pisethTang wants to merge 1 commit into
Open
Conversation
This compile-time configuration option was listed in ToDo.txt as untested. The new test verifies that basic assertions, sections, and checks still work correctly when the flag is enabled.
There was a problem hiding this comment.
Pull request overview
Adds a new ExtraTest to validate that Catch2 still runs basic test-case constructs when compiled with CATCH_CONFIG_FAST_COMPILE, addressing the existing “untested” note for this config.
Changes:
- Added
X96-FastCompile.cppextra test covering basic assertions and sections underCATCH_CONFIG_FAST_COMPILE. - Updated
tests/ExtraTests/CMakeLists.txtto build the newFastCompileexecutable and register it with CTest.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
tests/ExtraTests/X96-FastCompile.cpp |
New ExtraTest source that exercises basic REQUIRE/CHECK/SECTION usage under fast-compile mode. |
tests/ExtraTests/CMakeLists.txt |
Builds/runs the new ExtraTest and adds it to the extra test binaries list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| add_executable(FastCompile ${TESTS_DIR}/X96-FastCompile.cpp) | ||
| target_compile_definitions(FastCompile PRIVATE CATCH_CONFIG_FAST_COMPILE) | ||
| target_link_libraries(FastCompile PRIVATE Catch2::Catch2WithMain) |
| ) | ||
| set_tests_properties(CATCH_CONFIG_FAST_COMPILE | ||
| PROPERTIES | ||
| PASS_REGULAR_EXPRESSION "All tests passed" |
Comment on lines
+612
to
+615
| add_test( | ||
| NAME CATCH_CONFIG_FAST_COMPILE | ||
| COMMAND $<TARGET_FILE:FastCompile> | ||
| ) |
Comment on lines
+6
to
+18
| // SPDX-License-Identifier: BSL-1.0 | ||
|
|
||
|
|
||
|
|
||
| /**\file | ||
| * Test that Catch2 works correctly when CATCH_CONFIG_FAST_COMPILE | ||
| * is defined. | ||
| * | ||
| * This flag trades off some features for faster compilation. | ||
| */ | ||
|
|
||
| #include <catch2/catch_test_macros.hpp> | ||
|
|
Comment on lines
+25
to
+27
| SECTION("Sections still work") { | ||
| REQUIRE("hello" != "world"); | ||
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #3100 +/- ##
==========================================
+ Coverage 91.26% 91.30% +0.03%
==========================================
Files 204 204
Lines 8906 8906
==========================================
+ Hits 8128 8131 +3
+ Misses 778 775 -3 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an ExtraTest for
CATCH_CONFIG_FAST_COMPILE, which was listed asuntested in
tests/ExtraTests/ToDo.txt. The test verifies that basicassertions, sections, and checks still work correctly when this
compile-time flag is enabled.
GitHub Issues
No existing issue. This addresses the TODO in
tests/ExtraTests/ToDo.txt.