Skip to content

Add ExtraTest for CATCH_CONFIG_FAST_COMPILE#3100

Open
pisethTang wants to merge 1 commit into
catchorg:develfrom
pisethTang:add-fast-compile-extratest
Open

Add ExtraTest for CATCH_CONFIG_FAST_COMPILE#3100
pisethTang wants to merge 1 commit into
catchorg:develfrom
pisethTang:add-fast-compile-extratest

Conversation

@pisethTang
Copy link
Copy Markdown

Description

Adds an ExtraTest for CATCH_CONFIG_FAST_COMPILE, which was listed as
untested in tests/ExtraTests/ToDo.txt. The test verifies that basic
assertions, 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.

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.
Copilot AI review requested due to automatic review settings May 13, 2026 04:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cpp extra test covering basic assertions and sections under CATCH_CONFIG_FAST_COMPILE.
  • Updated tests/ExtraTests/CMakeLists.txt to build the new FastCompile executable 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
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.30%. Comparing base (6ee0826) to head (b0abb2e).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants