Compare commits

..

26 Commits

Author SHA1 Message Date
Martin Hořeňovský
71a3db4815 Fix Bazel sharding test that relied on tests being run in declaration order 2025-04-29 17:15:15 +02:00
Martin Hořeňovský
dba0b3fa82 Default to randomized test case order 2025-04-29 17:00:09 +02:00
Martin Hořeňovský
1e7b879fae Small include cleanup 2025-04-29 13:15:34 +02:00
ZXShady
4ff57aba42 Use variable templates 2025-04-27 21:14:04 -06:00
Chris Thrasher
dde8220613 Add VS 2025 CI jobs 2025-04-27 11:08:50 -06:00
Chris Thrasher
cecb02e68f Use presets in CI 2025-04-27 11:08:48 -06:00
Chris Thrasher
66085dac55 Simplify Windows CI jobs 2025-04-27 11:08:45 -06:00
Chris Thrasher
5a6d70eebb Remove unused headers 2025-04-27 11:08:41 -06:00
Chris Thrasher
10d1a2750c Simplify Linux CI jobs 2025-04-26 22:46:48 -06:00
Chris Thrasher
c17d69f813 Simplify macOS CI jobs 2025-04-26 22:46:45 -06:00
Chris Thrasher
4c93a595a1 Fix typos 2025-04-26 22:46:42 -06:00
Chris Thrasher
e8f4b60e62 Add more useful preset settings 2025-04-26 22:46:21 -06:00
Chris Thrasher
371b11b5a8 Modernize tools/misc/CMakeLists.txt 2025-04-26 22:46:13 -06:00
Chris Thrasher
8039e3ea1e Prevent unnecessarily finding C compiler 2025-04-26 12:05:22 -06:00
Chris Thrasher
1d3bfb324d Inherit C++14 requirement from upstream target 2025-04-26 11:00:03 -06:00
Chris Thrasher
5c97a8583d Use more modern -S for specifying CMake source dir 2025-04-26 10:59:42 -06:00
Chris Thrasher
8cfca70ae8 Fix formatting of CMake files
2 spaces seems to be the more common indentation level so that's what
I unified around.
2025-04-26 10:38:36 -06:00
Chris Thrasher
6aac11e17d Use CTest --output-on-failure flag 2025-04-26 10:37:44 -06:00
Chris Thrasher
ec571515c8 Don't fail CI fast 2025-04-26 10:37:36 -06:00
Chris Thrasher
edb6f80867 Export compile commands 2025-04-26 10:37:30 -06:00
Chris Thrasher
25b86ef3fd Upgrade CI runners to Ubuntu 22 2025-04-25 23:14:06 -06:00
Martin Hořeňovský
4c8671cfbb Add MAINTAINERS.md
Closes #2970
2025-04-18 16:29:44 +02:00
Mark Jansen
5b3b228603 Update generator docs with relevant headers 2025-04-12 12:05:58 -06:00
Chris Thrasher
2b60af89e2 v3.8.1 2025-04-08 12:40:18 -06:00
abhishekbelgaonkar23
f51dc98dfc Fix: Clang 19 -Wc++20-extensions warning (#2910) 2025-04-07 15:45:34 -06:00
Chris Thrasher
76f70b1403 Fix bug where catch_discover_tests fails when no TEST_CASEs are present 2025-03-12 14:03:56 -06:00
84 changed files with 1021 additions and 1194 deletions

View File

@@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(PackageTest CXX)
project(PackageTest LANGUAGES CXX)
find_package(Catch2 CONFIG REQUIRED)
add_executable(test_package test_package.cpp)
target_link_libraries(test_package Catch2::Catch2WithMain)
target_compile_features(test_package PRIVATE cxx_std_14)

View File

@@ -1,4 +1,4 @@
name: Bazel build
name: Linux Builds (Bazel)
on: [push, pull_request]
@@ -7,18 +7,18 @@ jobs:
name: Linux Ubuntu 22.04 Bazel build <GCC 11.2.0>
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compilation_mode: [fastbuild, dbg, opt]
steps:
- uses: actions/checkout@v4
- name: Mount bazel cache
- name: Mount Bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel-ubuntu22-gcc11
- name: Build Catch2
run: |
bazelisk build --compilation_mode=${{matrix.compilation_mode}} //...
- name: Build
run: bazelisk build --compilation_mode=${{matrix.compilation_mode}} //...

View File

@@ -1,4 +1,4 @@
name: Linux builds (meson)
name: Linux Builds (Meson)
on: [push, pull_request]
@@ -7,6 +7,7 @@ jobs:
name: meson ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
cxx:
- g++-11
@@ -25,7 +26,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y meson ninja-build ${{matrix.other_pkgs}}
- name: Configure build
- name: Configure
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: -std=c++${{matrix.std}} ${{matrix.cxxflags}}
@@ -34,11 +35,10 @@ jobs:
run: |
meson -Dbuildtype=${{matrix.build_type}} ${{runner.workspace}}/meson-build
- name: Build tests + lib
- name: Build
working-directory: ${{runner.workspace}}/meson-build
run: ninja
- name: Run tests
- name: Test
working-directory: ${{runner.workspace}}/meson-build
run: |
meson test --verbose
run: meson test --verbose

View File

@@ -1,72 +1,73 @@
# The builds in this file are more complex (e.g. they need custom CMake
# configuration) and thus are unsuitable to the simple build matrix
# approach used in simple-builds
name: Linux builds (complex)
name: Linux Builds (Complex)
on: [push, pull_request]
jobs:
build:
name: ${{matrix.build_description}}, ${{matrix.cxx}}, C++${{matrix.std}} ${{matrix.build_type}}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# We add builds one by one in this case, because there are no
# dimensions that are shared across the builds
include:
# Single surrogate header build
- cxx: clang++-10
- cxx: clang++-14
build_description: Surrogates build
build_type: Debug
std: 14
other_pkgs: clang-10
other_pkgs: clang-14
cmake_configurations: -DCATCH_BUILD_SURROGATES=ON
# Extras and examples with gcc-7
- cxx: g++-7
# Extras and examples with gcc-11
- cxx: g++-11
build_description: Extras + Examples
build_type: Debug
std: 14
other_pkgs: g++-7
other_pkgs: g++-11
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
- cxx: g++-7
- cxx: g++-11
build_description: Extras + Examples
build_type: Release
std: 14
other_pkgs: g++-7
other_pkgs: g++-11
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
# Extras and examples with Clang-10
- cxx: clang++-10
# Extras and examples with Clang-14
- cxx: clang++-14
build_description: Extras + Examples
build_type: Debug
std: 17
other_pkgs: clang-10
other_pkgs: clang-14
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
- cxx: clang++-10
- cxx: clang++-14
build_description: Extras + Examples
build_type: Release
std: 17
other_pkgs: clang-10
other_pkgs: clang-14
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
# Configure tests with Clang-10
- cxx: clang++-10
# Configure tests with Clang-14
- cxx: clang++-14
build_description: CMake configuration tests
build_type: Debug
std: 14
other_pkgs: clang-10
other_pkgs: clang-14
cmake_configurations: -DCATCH_ENABLE_CONFIGURE_TESTS=ON
# Valgrind test Clang-10
- cxx: clang++-10
build_description: Valgrind tests
build_type: Debug
std: 14
other_pkgs: clang-10 valgrind
cmake_configurations: -DMEMORYCHECK_COMMAND=`which valgrind` -DMEMORYCHECK_COMMAND_OPTIONS="-q --track-origins=yes --leak-check=full --num-callers=50 --show-leak-kinds=definite --error-exitcode=1"
other_ctest_args: -T memcheck -LE uses-python
# Valgrind test Clang-14
# - cxx: clang++-14
# build_description: Valgrind tests
# build_type: Debug
# std: 14
# other_pkgs: clang-14 valgrind
# cmake_configurations: -DMEMORYCHECK_COMMAND=`which valgrind` -DMEMORYCHECK_COMMAND_OPTIONS="-q --track-origins=yes --leak-check=full --num-callers=50 --show-leak-kinds=definite --error-exitcode=1"
# other_ctest_args: -T memcheck -LE uses-python
steps:
@@ -78,77 +79,51 @@ jobs:
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
cmake -Bbuild -H$GITHUB_WORKSPACE \
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCATCH_DEVELOPMENT_BUILD=ON \
${{matrix.cmake_configurations}} \
-G Ninja
${{matrix.cmake_configurations}}
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build -j --output-on-failure
- name: Run tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}} -j `nproc` ${{matrix.other_ctest_args}}
clang-tidy:
name: clang-tidy ${{matrix.version}}, ${{matrix.build_description}}, C++${{matrix.std}} ${{matrix.build_type}}
name: clang-tidy
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- version: "15"
build_description: all
build_type: Debug
std: 17
other_pkgs: ''
cmake_configurations: -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
steps:
- uses: actions/checkout@v4
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y ninja-build clang-${{matrix.version}} clang-tidy-${{matrix.version}} ${{matrix.other_pkgs}}
sudo apt-get install -y ninja-build clang-15 clang-tidy-15
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: clang++-${{matrix.version}}
CXXFLAGS: ${{matrix.cxxflags}}
- name: Configure
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
clangtidy="clang-tidy-${{matrix.version}};-use-color"
clangtidy="clang-tidy-15;-use-color"
# Use a dummy compiler/linker/ar/ranlib to effectively disable the
# compilation and only run clang-tidy.
cmake -Bbuild -H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCATCH_DEVELOPMENT_BUILD=ON \
-DCMAKE_CXX_CLANG_TIDY="$clangtidy" \
-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/true \
cmake --preset basic-tests -GNinja \
-DCMAKE_AR=/usr/bin/true \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_CLANG_TIDY="$clangtidy" \
-DCMAKE_CXX_COMPILER_AR=/usr/bin/true \
-DCMAKE_RANLIB=/usr/bin/true \
-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/true \
-DCMAKE_CXX_COMPILER=clang++-15 \
-DCMAKE_CXX_LINK_EXECUTABLE=/usr/bin/true \
${{matrix.cmake_configurations}} \
-G Ninja
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_RANLIB=/usr/bin/true \
-DCATCH_BUILD_EXAMPLES=ON \
-DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
- name: Run clang-tidy
working-directory: ${{runner.workspace}}/build
run: ninja
run: cmake --build build

View File

@@ -1,32 +1,33 @@
name: Linux builds (basic)
name: Linux Builds (Basic)
on: [push, pull_request]
jobs:
build:
name: ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
cxx:
- g++-5
- g++-6
- g++-7
- g++-8
- g++-9
- g++-10
- g++-11
- g++-12
- clang++-6.0
- clang++-7
- clang++-8
- clang++-9
- clang++-10
- clang++-11
- clang++-12
- clang++-13
- clang++-14
build_type: [Debug, Release]
std: [14]
include:
- cxx: g++-5
other_pkgs: g++-5
- cxx: g++-6
other_pkgs: g++-6
- cxx: g++-7
other_pkgs: g++-7
- cxx: g++-8
@@ -35,6 +36,10 @@ jobs:
other_pkgs: g++-9
- cxx: g++-10
other_pkgs: g++-10
- cxx: g++-11
other_pkgs: g++-11
- cxx: g++-12
other_pkgs: g++-12
- cxx: clang++-6.0
other_pkgs: clang-6.0
- cxx: clang++-7
@@ -45,79 +50,64 @@ jobs:
other_pkgs: clang-9
- cxx: clang++-10
other_pkgs: clang-10
# Clang 6 + C++17
# does not work with the default libstdc++ version thanks
# to a disagreement on variant implementation.
# - cxx: clang++-6.0
# build_type: Debug
# std: 17
# other_pkgs: clang-6.0
# - cxx: clang++-6.0
# build_type: Release
# std: 17
# other_pkgs: clang-6.0
# Clang 10 + C++17
- cxx: clang++-10
- cxx: clang++-11
other_pkgs: clang-11
- cxx: clang++-12
other_pkgs: clang-12
- cxx: clang++-13
other_pkgs: clang-13
- cxx: clang++-14
other_pkgs: clang-14
# Clang 14 + C++17
- cxx: clang++-14
build_type: Debug
std: 17
other_pkgs: clang-10
- cxx: clang++-10
other_pkgs: clang-14
- cxx: clang++-14
build_type: Release
std: 17
other_pkgs: clang-10
- cxx: clang++-10
other_pkgs: clang-14
- cxx: clang++-14
build_type: Debug
std: 20
other_pkgs: clang-10
- cxx: clang++-10
other_pkgs: clang-14
- cxx: clang++-14
build_type: Release
std: 20
other_pkgs: clang-10
- cxx: g++-10
other_pkgs: clang-14
- cxx: g++-11
build_type: Debug
std: 20
other_pkgs: g++-10
- cxx: g++-10
other_pkgs: g++-11
- cxx: g++-11
build_type: Release
std: 20
other_pkgs: g++-10
other_pkgs: g++-11
steps:
- uses: actions/checkout@v4
- name: Add repositories for older GCC
- name: Add repositories for older compilers
run: |
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic main'
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic universe'
if: ${{ matrix.cxx == 'g++-5' || matrix.cxx == 'g++-6' }}
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ focal main'
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ focal universe'
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
- name: Configure
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
cmake -Bbuild -H$GITHUB_WORKSPACE \
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCATCH_DEVELOPMENT_BUILD=ON \
-G Ninja
-DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}}
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja
- name: Build
run: cmake --build build
- name: Run tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}} -j `nproc`
- name: Test
run: ctest --test-dir build -j --output-on-failure

View File

@@ -1,44 +0,0 @@
name: Arm Mac builds
on: [push, pull_request]
jobs:
build:
runs-on: macos-14
strategy:
matrix:
cxx:
- clang++
build_type: [Debug, Release]
std: [14, 17]
include:
- build_type: Debug
examples: ON
extra_tests: ON
steps:
- uses: actions/checkout@v4
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
run: |
cmake -Bbuild -H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCATCH_DEVELOPMENT_BUILD=ON \
-DCATCH_BUILD_EXAMPLES=${{matrix.examples}} \
-DCATCH_BUILD_EXTRA_TESTS=${{matrix.examples}}
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: make -j `sysctl -n hw.ncpu`
- name: Run tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}} -j `sysctl -n hw.ncpu`

View File

@@ -1,48 +1,32 @@
name: Intel Mac builds
name: Mac Builds
on: [push, pull_request]
jobs:
build:
# From macos-14 forward, the baseline "macos-X" image is Arm based,
# and not Intel based. Thus this is the newest image we can use for
# Intel MacOS CI, and there don't seem to be any plans to keep providing
# the Intel based images for free to OSS projects.
runs-on: macos-13
# and not Intel based.
runs-on: ${{matrix.image}}
strategy:
fail-fast: false
matrix:
cxx:
- clang++
image: [macos-13, macos-14, macos-15]
build_type: [Debug, Release]
std: [14, 17]
include:
- build_type: Debug
examples: ON
extra_tests: ON
steps:
- uses: actions/checkout@v4
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
- name: Configure
run: |
cmake -Bbuild -H$GITHUB_WORKSPACE \
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCATCH_DEVELOPMENT_BUILD=ON \
-DCATCH_BUILD_EXAMPLES=${{matrix.examples}} \
-DCATCH_BUILD_EXTRA_TESTS=${{matrix.examples}}
-DCATCH_BUILD_EXAMPLES=ON \
-DCATCH_BUILD_EXTRA_TESTS=ON
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: make -j `sysctl -n hw.ncpu`
- name: Build
run: cmake --build build
- name: Run tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}} -j `sysctl -n hw.ncpu`
- name: Test
run: ctest --test-dir build -j --output-on-failure

View File

@@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
conan_builds:
name: Conan ${{matrix.conan_version}}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
conan_version:

View File

@@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
build:
# Set the type of machine to run on
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout source code

View File

@@ -1,4 +1,4 @@
name: Windows builds (basic)
name: Windows Builds (Basic)
on: [push, pull_request]
@@ -7,8 +7,9 @@ jobs:
name: ${{matrix.os}}, ${{matrix.std}}, ${{matrix.build_type}}, ${{matrix.platform}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
os: [windows-2019, windows-2022, windows-2025]
platform: [Win32, x64]
build_type: [Debug, Release]
std: [14, 17]
@@ -16,22 +17,15 @@ jobs:
- uses: actions/checkout@v4
- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -S $Env:GITHUB_WORKSPACE `
-B ${{runner.workspace}}/build `
-DCMAKE_CXX_STANDARD=${{matrix.std}} `
cmake --preset all-tests `
-A ${{matrix.platform}} `
--preset all-tests
-DCMAKE_CXX_STANDARD=${{matrix.std}} `
- name: Build tests
working-directory: ${{runner.workspace}}
run: cmake --build build --config ${{matrix.build_type}} --parallel %NUMBER_OF_PROCESSORS%
shell: cmd
- name: Run tests
working-directory: ${{runner.workspace}}/build
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest -C ${{matrix.build_type}} -j %NUMBER_OF_PROCESSORS%
run: ctest --test-dir build -C ${{matrix.build_type}} -j %NUMBER_OF_PROCESSORS% --output-on-failure
shell: cmd

View File

@@ -68,7 +68,7 @@ expand_template(
cc_library(
name = "catch2_generated",
hdrs = ["catch2/catch_user_config.hpp"],
include_prefix = ".", # to manipulate -I of dependenices
include_prefix = ".", # to manipulate -I of dependencies
visibility = ["//visibility:public"],
)

View File

@@ -1,6 +1,5 @@
@PACKAGE_INIT@
# Avoid repeatedly including the targets
if(NOT TARGET Catch2::Catch2)
# Provide path for scripts

View File

@@ -14,7 +14,6 @@
#
# For detailed docs look into docs/configuration.md
macro(AddOverridableConfigOption OptionBaseName)
option(CATCH_CONFIG_${OptionBaseName} "Read docs/configuration.md for details" OFF)
option(CATCH_CONFIG_NO_${OptionBaseName} "Read docs/configuration.md for details" OFF)

View File

@@ -39,7 +39,6 @@ function(add_warnings_to_targets targets)
target_compile_options(${target} PRIVATE /w44265 /w44061 /w44062 /w45038)
endif()
endforeach()
endif()
if(NOT MSVC)

View File

@@ -26,7 +26,6 @@ cmake_dependent_option(CATCH_BUILD_SURROGATES "Enable generating and building su
cmake_dependent_option(CATCH_ENABLE_CONFIGURE_TESTS "Enable CMake configuration tests. WARNING: VERY EXPENSIVE" OFF "CATCH_DEVELOPMENT_BUILD" OFF)
cmake_dependent_option(CATCH_ENABLE_CMAKE_HELPER_TESTS "Enable CMake helper tests. WARNING: VERY EXPENSIVE" OFF "CATCH_DEVELOPMENT_BUILD" OFF)
# Catch2's build breaks if done in-tree. You probably should not build
# things in tree anyway, but we can allow projects that include Catch2
# as a subproject to build in-tree as long as it is not in our tree.
@@ -35,7 +34,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()
project(Catch2
VERSION 3.8.0 # CML version placeholder, don't delete
VERSION 3.8.1 # CML version placeholder, don't delete
LANGUAGES CXX
HOMEPAGE_URL "https://github.com/catchorg/Catch2"
DESCRIPTION "A modern, C++-native, unit test framework."
@@ -70,7 +69,6 @@ if(CATCH_TEST_USE_WMAIN)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
endif()
# Basic paths
set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SOURCES_DIR ${CATCH_DIR}/src/catch2)
@@ -192,7 +190,5 @@ if (NOT_SUBPROJECT)
set(CPACK_PACKAGE_CONTACT "https://github.com/catchorg/Catch2/")
include(CPack)
endif()

View File

@@ -3,9 +3,14 @@
"configurePresets": [
{
"name": "basic-tests",
"binaryDir": "build",
"installDir": "build/install",
"displayName": "Basic development build",
"description": "Enables development build with basic tests that are cheap to build and run",
"cacheVariables": {
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_STANDARD_REQUIRED": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CATCH_DEVELOPMENT_BUILD": "ON"
}
},

11
MAINTAINERS.md Normal file
View File

@@ -0,0 +1,11 @@
<a id="top"></a>
# Catch2 Maintainers
## Current
* Chris Thrasher ([@christhrasher](https://github.com/ChrisThrasher)), gpg key: 56FB686C9DFC8E2C
* Martin Hořeňovský ([@horenmar](https://github.com/horenmar)), gpg key: E29C46F3B8A7502860793B7DECC9C20E314B2360
## Retired
* Phil Nash ([@philsquared](https://github.com/philsquared))

View File

@@ -123,7 +123,7 @@ specs. You can:
This allows test cases that are tagged with **either** "[some-tag]" **or**
"[other-tag]". A test case with both will obviously also pass the filter.
Note that commas take precendence over simple concatenation. This means
Note that commas take precedence over simple concatenation. This means
that `[a][b],[c]` accepts tests that are tagged with either both "[a]" and
"[b]", or tests that are tagged with just "[c]".

View File

@@ -21,7 +21,10 @@ The "Generators" `TEST_CASE` will be entered 3 times, and the value of
`i` will be 1, 3, and 5 in turn. `GENERATE`s can also be used multiple
times at the same scope, in which case the result will be a cartesian
product of all elements in the generators. This means that in the snippet
below, the test case will be run 6 (2\*3) times.
below, the test case will be run 6 (2\*3) times. The `GENERATE` macro
is defined in the `catch_generators.hpp` header, so compiling
the code examples below also requires
`#include <catch2/generators/catch_generators.hpp>`.
```cpp
TEST_CASE("Generators") {
@@ -103,7 +106,7 @@ a test case,
* 2 fundamental generators
* `SingleValueGenerator<T>` -- contains only single element
* `FixedValuesGenerator<T>` -- contains multiple elements
* 5 generic generators that modify other generators
* 5 generic generators that modify other generators (defined in `catch2/generators/catch_generators_adapters.hpp`)
* `FilterGenerator<T, Predicate>` -- filters out elements from a generator
for which the predicate returns "false"
* `TakeGenerator<T>` -- takes first `n` elements from a generator
@@ -111,11 +114,11 @@ a test case,
* `MapGenerator<T, U, Func>` -- returns the result of applying `Func`
on elements from a different generator
* `ChunkGenerator<T>` -- returns chunks (inside `std::vector`) of n elements from a generator
* 4 specific purpose generators
* 4 specific purpose generators (defined in `catch2/generators/catch_generators_random.hpp`)
* `RandomIntegerGenerator<Integral>` -- generates random Integrals from range
* `RandomFloatGenerator<Float>` -- generates random Floats from range
* `RangeGenerator<T>(first, last)` -- generates all values inside a `[first, last)` arithmetic range
* `IteratorGenerator<T>` -- copies and returns values from an iterator range
* `RangeGenerator<T>(first, last)` -- generates all values inside a `[first, last)` arithmetic range (defined in `catch2/generators/catch_generators_range.hpp`)
* `IteratorGenerator<T>` -- copies and returns values from an iterator range (defined in `catch2/generators/catch_generators_range.hpp`)
> `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch2 2.7.0.
@@ -216,8 +219,8 @@ For floating point generators, the situation is much more complex.
Generally Catch2 only promises reproducibility (or even just correctness!)
on platforms that obey the IEEE-754 standard. Furthermore, reproducibility
only applies between binaries that perform floating point math in the
same way, e.g. if you compile a binary targetting the x87 FPU and another
one targetting SSE2 for floating point math, their results will vary.
same way, e.g. if you compile a binary targeting the x87 FPU and another
one targeting SSE2 for floating point math, their results will vary.
Similarly, binaries compiled with compiler flags that relax the IEEE-754
adherence, e.g. `-ffast-math`, might provide different results than those
compiled for strict IEEE-754 adherence.

View File

@@ -2,6 +2,7 @@
# Release notes
**Contents**<br>
[3.8.1](#381)<br>
[3.8.0](#380)<br>
[3.7.1](#371)<br>
[3.7.0](#370)<br>
@@ -66,6 +67,13 @@
[Even Older versions](#even-older-versions)<br>
## 3.8.1
### Fixes
* Fixed bug where catch_discover_tests fails when no TEST_CASEs are present (#2962)
* Fixed Clang 19 -Wc++20-extensions warning (#2968)
## 3.8.0
### Improvements
@@ -85,7 +93,7 @@
* Removed redundant `CTEST_FILE` param when creating the indirection file for `PRE_TEST` discovery mode (#2936)
* Rewrote the test discovery logic to use output from the JSON reporter
* This means that `catch_discover_tests` now requires CMake 3.19 or newer
* Added `ADD_TAGS_AS_LABELS` option. If specified, each CTest test will be labeled with corrensponding Catch2's test tag
* Added `ADD_TAGS_AS_LABELS` option. If specified, each CTest test will be labeled with corresponding Catch2's test tag
* Bumped up the minimum required CMake version to build Catch2 to 3.16
* Meson build now provides option to avoid installing Catch2
* Bazel build is moved to Bzlmod.
@@ -167,7 +175,7 @@
### Improvements
* Reintroduced support for GCC 5 and 6 (#2836)
* As with VS2017, if they start causing trouble again, they will be dropped again.
* Added workaround for targetting newest MacOS (Sonoma) using GCC (#2837, #2839)
* Added workaround for targeting newest MacOS (Sonoma) using GCC (#2837, #2839)
* `CATCH_CONFIG_DEFAULT_REPORTER` can now be an arbitrary reporter spec
* Previously it could only be a plain reporter name, so it was impossible to compile in custom arguments to the reporter.
* Improved performance of generating 64bit random integers by 20+%

View File

@@ -130,7 +130,7 @@ TEST_CASE_PERSISTENT_FIXTURE( MyFixture, "Tests with MyFixture" ) {
}
```
This example demonstates two possible use-cases of this fixture type:
This example demonstrates two possible use-cases of this fixture type:
1. Improve test run times by reducing the amount of expensive and
redundant setup and tear-down required.
2. Reusing results from the previous partial run, in the current

View File

@@ -1,10 +1,8 @@
cmake_minimum_required(VERSION 3.16)
project(Catch2Examples LANGUAGES CXX)
message(STATUS "Examples included")
# Some one-offs first:
# 1) Tests and main in one file
add_executable(010-TestCase
@@ -42,7 +40,6 @@ set( SOURCES_IDIOMATIC_EXAMPLES
string(REPLACE ".cpp" "" BASENAMES_IDIOMATIC_EXAMPLES "${SOURCES_IDIOMATIC_EXAMPLES}")
set(TARGETS_IDIOMATIC_EXAMPLES ${BASENAMES_IDIOMATIC_EXAMPLES})
foreach(name ${TARGETS_IDIOMATIC_EXAMPLES})
add_executable(${name} ${name}.cpp)
endforeach()
@@ -57,6 +54,5 @@ foreach( name ${ALL_EXAMPLE_TARGETS} )
target_link_libraries(${name} Catch2WithMain)
endforeach()
list(APPEND CATCH_WARNING_TARGETS ${ALL_EXAMPLE_TARGETS})
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)

View File

@@ -143,6 +143,12 @@ function(catch_discover_tests_impl)
# Speed-up reparsing by cutting away unneeded parts of JSON.
string(JSON test_listing GET "${listing_output}" "listings" "tests")
string(JSON num_tests LENGTH "${test_listing}")
# Exit early if no tests are detected
if(num_tests STREQUAL "0")
return()
endif()
# CMake's foreach-RANGE is inclusive, so we have to subtract 1
math(EXPR num_tests "${num_tests} - 1")

View File

@@ -61,8 +61,6 @@ function(catch_add_sharded_tests TARGET)
-P "${shard_impl_script_file}"
VERBATIM
)
endfunction()

View File

@@ -234,8 +234,6 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
APPEND
PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
endif()
endforeach()
endfunction()

View File

@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
// Catch v3.8.0
// Generated: 2025-01-06 00:39:54.679994
// Catch v3.8.1
// Generated: 2025-04-08 12:33:19.863332
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
@@ -2283,7 +2283,7 @@ namespace Catch {
}
Version const& libraryVersion() {
static Version version( 3, 8, 0, "", 0 );
static Version version( 3, 8, 1, "", 0 );
return version;
}

View File

@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
// Catch v3.8.0
// Generated: 2025-01-06 00:39:54.340018
// Catch v3.8.1
// Generated: 2025-04-08 12:33:19.851017
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
@@ -191,8 +191,16 @@
# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
# if (__clang_major__ >= 20)
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wvariadic-macro-arguments-omitted\"" )
# elif (__clang_major__ == 19)
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wc++20-extensions\"" )
# else
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
_Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
# endif
# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
@@ -7342,7 +7350,7 @@ namespace Catch {
#define CATCH_VERSION_MAJOR 3
#define CATCH_VERSION_MINOR 8
#define CATCH_VERSION_PATCH 0
#define CATCH_VERSION_PATCH 1
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED

View File

@@ -8,7 +8,7 @@
project(
'catch2',
'cpp',
version: '3.8.0', # CML version placeholder, don't delete
version: '3.8.1', # CML version placeholder, don't delete
license: 'BSL-1.0',
meson_version: '>=0.54.1',
)

View File

@@ -40,7 +40,6 @@ set(BENCHMARK_SOURCES
)
set(BENCHMARK_FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES})
set(IMPL_HEADERS
"${PROJECT_BINARY_DIR}/generated-includes/catch2/catch_user_config.hpp"
${SOURCES_DIR}/catch_user_config.hpp.in
@@ -360,13 +359,11 @@ endif()
set_target_properties(Catch2 PROPERTIES
DEBUG_POSTFIX "d"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION})
SOVERSION ${PROJECT_VERSION}
)
# require C++14
target_compile_features(Catch2
PUBLIC
cxx_std_14
)
target_compile_features(Catch2 PUBLIC cxx_std_14)
configure_file(
"${SOURCES_DIR}/catch_user_config.hpp.in"
@@ -413,7 +410,6 @@ if (NOT_SUBPROJECT)
${CMAKE_INSTALL_BINDIR}
)
install(
EXPORT
Catch2Targets
@@ -450,20 +446,13 @@ if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS)
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/generated-includes>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_definitions(Catch2_buildall_interface
INTERFACE
CATCH_CONFIG_STATIC
)
target_compile_features(Catch2_buildall_interface
INTERFACE
cxx_std_14
)
target_compile_definitions(Catch2_buildall_interface INTERFACE CATCH_CONFIG_STATIC)
target_compile_features(Catch2_buildall_interface INTERFACE cxx_std_14)
endif()
list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain)
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)
# We still do not support building dynamic library with hidden visibility
# so we want to check & warn users if they do this. However, we won't abort
# the configuration step so that we don't have to also provide an override.

View File

@@ -97,7 +97,7 @@ namespace Catch {
}
// sets lambda to be used in fun *and* executes benchmark!
template <typename Fun, std::enable_if_t<!Detail::is_related<Fun, Benchmark>::value, int> = 0>
template <typename Fun, std::enable_if_t<!Detail::is_related_v<Fun, Benchmark>, int> = 0>
Benchmark & operator=(Fun func) {
auto const* cfg = getCurrentContext().getConfig();
if (!cfg->skipBenchmarks()) {

View File

@@ -21,8 +21,7 @@ namespace Catch {
namespace Benchmark {
namespace Detail {
template <typename T, typename U>
struct is_related
: std::is_same<std::decay_t<T>, std::decay_t<U>> {};
static constexpr bool is_related_v = std::is_same<std::decay_t<T>, std::decay_t<U>>::value;
/// We need to reinvent std::function because every piece of code that might add overhead
/// in a measurement context needs to have consistent performance characteristics so that we
@@ -63,7 +62,7 @@ namespace Catch {
BenchmarkFunction();
template <typename Fun,
std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value, int> = 0>
std::enable_if_t<!is_related_v<Fun, BenchmarkFunction>, int> = 0>
BenchmarkFunction(Fun&& fun)
: f(new model<std::decay_t<Fun>>(CATCH_FORWARD(fun))) {}

View File

@@ -15,7 +15,6 @@
#include <catch2/benchmark/detail/catch_stats.hpp>
#include <catch2/benchmark/detail/catch_measure.hpp>
#include <catch2/benchmark/detail/catch_run_for_at_least.hpp>
#include <catch2/benchmark/catch_clock.hpp>
#include <catch2/internal/catch_unique_ptr.hpp>
#include <algorithm>

View File

@@ -13,8 +13,6 @@
#include <catch2/benchmark/catch_clock.hpp>
#include <catch2/benchmark/detail/catch_complete_invoke.hpp>
#include <type_traits>
namespace Catch {
namespace Benchmark {
template <typename Result>

View File

@@ -76,7 +76,7 @@ namespace Catch {
WarnAbout::What warnings = WarnAbout::Nothing;
ShowDurations showDurations = ShowDurations::DefaultForReporter;
double minDuration = -1;
TestRunOrder runOrder = TestRunOrder::Declared;
TestRunOrder runOrder = TestRunOrder::Randomized;
ColourMode defaultColourMode = ColourMode::PlatformDefault;
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;

View File

@@ -25,7 +25,6 @@
#include <catch2/internal/catch_stdstreams.hpp>
#include <catch2/internal/catch_istream.hpp>
#include <algorithm>
#include <cassert>
#include <exception>
#include <iomanip>

View File

@@ -11,7 +11,6 @@
#include <catch2/internal/catch_context.hpp>
#include <catch2/internal/catch_polyfills.hpp>
#include <cmath>
#include <iomanip>
namespace Catch {

View File

@@ -64,18 +64,14 @@ namespace Catch {
return rawMemoryToString( &object, sizeof(object) );
}
template<typename T,typename = void>
static constexpr bool IsStreamInsertable_v = false;
template <typename T>
class IsStreamInsertable {
template<typename Stream, typename U>
static auto test(int)
-> decltype(std::declval<Stream&>() << std::declval<U>(), std::true_type());
template<typename, typename>
static auto test(...)->std::false_type;
public:
static const bool value = decltype(test<std::ostream, const T&>(0))::value;
};
static constexpr bool IsStreamInsertable_v<
T,
decltype( void( std::declval<std::ostream&>() << std::declval<T>() ) )> =
true;
template<typename E>
std::string convertUnknownEnumToString( E e );
@@ -120,7 +116,7 @@ namespace Catch {
struct StringMaker {
template <typename Fake = T>
static
std::enable_if_t<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>
std::enable_if_t<::Catch::Detail::IsStreamInsertable_v<Fake>, std::string>
convert(const Fake& value) {
ReusableStringStream rss;
// NB: call using the function-like syntax to avoid ambiguity with
@@ -131,7 +127,7 @@ namespace Catch {
template <typename Fake = T>
static
std::enable_if_t<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>
std::enable_if_t<!::Catch::Detail::IsStreamInsertable_v<Fake>, std::string>
convert( const Fake& value ) {
#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
return Detail::convertUnstreamable(value);
@@ -523,7 +519,7 @@ namespace Catch {
}
template<typename R>
struct StringMaker<R, std::enable_if_t<is_range<R>::value && !::Catch::Detail::IsStreamInsertable<R>::value>> {
struct StringMaker<R, std::enable_if_t<is_range<R>::value && !::Catch::Detail::IsStreamInsertable_v<R>>> {
static std::string convert( R const& range ) {
return rangeToString( range );
}

View File

@@ -36,7 +36,7 @@ namespace Catch {
}
Version const& libraryVersion() {
static Version version( 3, 8, 0, "", 0 );
static Version version( 3, 8, 1, "", 0 );
return version;
}

View File

@@ -10,6 +10,6 @@
#define CATCH_VERSION_MAJOR 3
#define CATCH_VERSION_MINOR 8
#define CATCH_VERSION_PATCH 0
#define CATCH_VERSION_PATCH 1
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED

View File

@@ -12,7 +12,6 @@
#include <catch2/internal/catch_stringref.hpp>
#include <chrono>
#include <iosfwd>
#include <string>
#include <vector>

View File

@@ -20,7 +20,6 @@
#include <map>
#include <string>
#include <vector>
#include <iosfwd>
namespace Catch {

View File

@@ -103,8 +103,16 @@
# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
# if (__clang_major__ >= 20)
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wvariadic-macro-arguments-omitted\"" )
# elif (__clang_major__ == 19)
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wc++20-extensions\"" )
# else
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
_Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
# endif
# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wunused-template\"" )

View File

@@ -45,7 +45,7 @@
* when the compiler handles `ExprLhs<T> == b`, it also tries to resolve
* the overload set for `b == ExprLhs<T>`.
*
* To accomodate these use cases, decomposer ended up rather complex.
* To accommodate these use cases, decomposer ended up rather complex.
*
* 1) These types are handled by adding SFINAE overloads to our comparison
* operators, checking whether `T == U` are comparable with the given
@@ -163,7 +163,7 @@ namespace Catch {
public:
constexpr auto isBinaryExpression() const -> bool { return m_isBinaryExpression; }
constexpr auto getResult() const -> bool { return m_result; }
//! This function **has** to be overriden by the derived class.
//! This function **has** to be overridden by the derived class.
virtual void streamReconstructedExpression( std::ostream& os ) const;
constexpr ITransientExpression( bool isBinaryExpression, bool result )

View File

@@ -12,7 +12,7 @@
#include <catch2/internal/catch_compiler_capabilities.hpp>
#include <catch2/internal/catch_reusable_string_stream.hpp>
#include <exception>
#include <exception> // for `std::exception` in no-exception configuration
namespace Catch {
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)

View File

@@ -11,7 +11,6 @@
#include <catch2/interfaces/catch_interfaces_exception.hpp>
#include <catch2/internal/catch_unique_ptr.hpp>
#include <vector>
#include <string>
namespace Catch {

View File

@@ -8,8 +8,8 @@
#ifndef CATCH_IS_PERMUTATION_HPP_INCLUDED
#define CATCH_IS_PERMUTATION_HPP_INCLUDED
#include <algorithm>
#include <iterator>
#include <type_traits>
namespace Catch {
namespace Detail {

View File

@@ -14,8 +14,6 @@
#include <cstdio>
#include <fstream>
#include <sstream>
#include <vector>
namespace Catch {

View File

@@ -12,8 +12,6 @@
#include <catch2/internal/catch_unique_ptr.hpp>
#include <iosfwd>
#include <cstddef>
#include <ostream>
#include <string>
namespace Catch {

View File

@@ -361,7 +361,7 @@ namespace Catch {
auto& currentTracker = m_trackerContext.currentTracker();
assert(
currentTracker.nameAndLocation() != nameAndLoc &&
"Trying to create tracker for a genreator that already has one" );
"Trying to create tracker for a generator that already has one" );
auto newTracker = Catch::Detail::make_unique<Generators::GeneratorTracker>(
CATCH_MOVE(nameAndLoc), m_trackerContext, &currentTracker );

View File

@@ -62,7 +62,7 @@ namespace Catch {
#else
// These section definitions imply that at most one section at one level
// will be intered (because only one section's __LINE__ can be equal to
// will be entered (because only one section's __LINE__ can be equal to
// the dummy `catchInternalSectionHint` variable from `TEST_CASE`).
namespace Catch {

View File

@@ -9,7 +9,6 @@
#define CATCH_SHARDING_HPP_INCLUDED
#include <cassert>
#include <cmath>
#include <algorithm>
namespace Catch {

View File

@@ -74,7 +74,7 @@ namespace Catch {
std::string origStr = CATCH_MOVE(str);
str.clear();
// There is at least one replacement, so reserve with the best guess
// we can make without actually counting the number of occurences.
// we can make without actually counting the number of occurrences.
str.reserve(origStr.size() - replaceThis.size() + withThis.size());
do {
str.append(origStr, copyBegin, i-copyBegin );

View File

@@ -10,7 +10,6 @@
#include <algorithm>
#include <ostream>
#include <cstring>
#include <cstdint>
namespace Catch {
StringRef::StringRef( char const* rawChars ) noexcept

View File

@@ -79,7 +79,7 @@ namespace Catch {
//! Creates a matcher that accepts ranges/containers with specific size
HasSizeMatcher SizeIs(std::size_t sz);
template <typename Matcher>
std::enable_if_t<Detail::is_matcher<Matcher>::value,
std::enable_if_t<Detail::is_matcher_v<Matcher>,
SizeMatchesMatcher<Matcher>> SizeIs(Matcher&& m) {
return SizeMatchesMatcher<Matcher>{CATCH_FORWARD(m)};
}

View File

@@ -11,8 +11,8 @@
#include <catch2/matchers/catch_matchers_templated.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>
#include <algorithm>
#include <functional>
#include <type_traits>
namespace Catch {
namespace Matchers {
@@ -74,14 +74,14 @@ namespace Catch {
* Uses `std::equal_to` to do the comparison
*/
template <typename T>
std::enable_if_t<!Detail::is_matcher<T>::value,
std::enable_if_t<!Detail::is_matcher_v<T>,
ContainsElementMatcher<T, std::equal_to<>>> Contains(T&& elem) {
return { CATCH_FORWARD(elem), std::equal_to<>{} };
}
//! Creates a matcher that checks whether a range contains element matching a matcher
template <typename Matcher>
std::enable_if_t<Detail::is_matcher<Matcher>::value,
std::enable_if_t<Detail::is_matcher_v<Matcher>,
ContainsMatcherMatcher<Matcher>> Contains(Matcher&& matcher) {
return { CATCH_FORWARD(matcher) };
}

View File

@@ -11,8 +11,7 @@
#include <catch2/internal/catch_is_permutation.hpp>
#include <catch2/matchers/catch_matchers_templated.hpp>
#include <algorithm>
#include <utility>
#include <functional>
namespace Catch {
namespace Matchers {

View File

@@ -58,19 +58,19 @@ namespace Matchers {
}
template<typename T>
using is_generic_matcher = std::is_base_of<
static constexpr bool is_generic_matcher_v = std::is_base_of<
Catch::Matchers::MatcherGenericBase,
std::remove_cv_t<std::remove_reference_t<T>>
>;
>::value;
template<typename... Ts>
using are_generic_matchers = Catch::Detail::conjunction<is_generic_matcher<Ts>...>;
static constexpr bool are_generic_matchers_v = Catch::Detail::conjunction<std::integral_constant<bool,is_generic_matcher_v<Ts>>...>::value;
template<typename T>
using is_matcher = std::is_base_of<
static constexpr bool is_matcher_v = std::is_base_of<
Catch::Matchers::MatcherUntypedBase,
std::remove_cv_t<std::remove_reference_t<T>>
>;
>::value;
template<std::size_t N, typename Arg>
@@ -143,7 +143,7 @@ namespace Matchers {
//! Avoids type nesting for `GenericAllOf && some matcher` case
template<typename MatcherRHS>
friend std::enable_if_t<is_matcher<MatcherRHS>::value,
friend std::enable_if_t<is_matcher_v<MatcherRHS>,
MatchAllOfGeneric<MatcherTs..., MatcherRHS>> operator && (
MatchAllOfGeneric<MatcherTs...>&& lhs,
MatcherRHS const& rhs) {
@@ -152,7 +152,7 @@ namespace Matchers {
//! Avoids type nesting for `some matcher && GenericAllOf` case
template<typename MatcherLHS>
friend std::enable_if_t<is_matcher<MatcherLHS>::value,
friend std::enable_if_t<is_matcher_v<MatcherLHS>,
MatchAllOfGeneric<MatcherLHS, MatcherTs...>> operator && (
MatcherLHS const& lhs,
MatchAllOfGeneric<MatcherTs...>&& rhs) {
@@ -197,7 +197,7 @@ namespace Matchers {
//! Avoids type nesting for `GenericAnyOf || some matcher` case
template<typename MatcherRHS>
friend std::enable_if_t<is_matcher<MatcherRHS>::value,
friend std::enable_if_t<is_matcher_v<MatcherRHS>,
MatchAnyOfGeneric<MatcherTs..., MatcherRHS>> operator || (
MatchAnyOfGeneric<MatcherTs...>&& lhs,
MatcherRHS const& rhs) {
@@ -206,7 +206,7 @@ namespace Matchers {
//! Avoids type nesting for `some matcher || GenericAnyOf` case
template<typename MatcherLHS>
friend std::enable_if_t<is_matcher<MatcherLHS>::value,
friend std::enable_if_t<is_matcher_v<MatcherLHS>,
MatchAnyOfGeneric<MatcherLHS, MatcherTs...>> operator || (
MatcherLHS const& lhs,
MatchAnyOfGeneric<MatcherTs...>&& rhs) {
@@ -246,20 +246,20 @@ namespace Matchers {
// compose only generic matchers
template<typename MatcherLHS, typename MatcherRHS>
std::enable_if_t<Detail::are_generic_matchers<MatcherLHS, MatcherRHS>::value, Detail::MatchAllOfGeneric<MatcherLHS, MatcherRHS>>
std::enable_if_t<Detail::are_generic_matchers_v<MatcherLHS, MatcherRHS>, Detail::MatchAllOfGeneric<MatcherLHS, MatcherRHS>>
operator && (MatcherLHS const& lhs, MatcherRHS const& rhs) {
return { lhs, rhs };
}
template<typename MatcherLHS, typename MatcherRHS>
std::enable_if_t<Detail::are_generic_matchers<MatcherLHS, MatcherRHS>::value, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherRHS>>
std::enable_if_t<Detail::are_generic_matchers_v<MatcherLHS, MatcherRHS>, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherRHS>>
operator || (MatcherLHS const& lhs, MatcherRHS const& rhs) {
return { lhs, rhs };
}
//! Wrap provided generic matcher in generic negator
template<typename MatcherT>
std::enable_if_t<Detail::is_generic_matcher<MatcherT>::value, Detail::MatchNotOfGeneric<MatcherT>>
std::enable_if_t<Detail::is_generic_matcher_v<MatcherT>, Detail::MatchNotOfGeneric<MatcherT>>
operator ! (MatcherT const& matcher) {
return Detail::MatchNotOfGeneric<MatcherT>{matcher};
}
@@ -267,25 +267,25 @@ namespace Matchers {
// compose mixed generic and non-generic matchers
template<typename MatcherLHS, typename ArgRHS>
std::enable_if_t<Detail::is_generic_matcher<MatcherLHS>::value, Detail::MatchAllOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>>
std::enable_if_t<Detail::is_generic_matcher_v<MatcherLHS>, Detail::MatchAllOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>>
operator && (MatcherLHS const& lhs, MatcherBase<ArgRHS> const& rhs) {
return { lhs, rhs };
}
template<typename ArgLHS, typename MatcherRHS>
std::enable_if_t<Detail::is_generic_matcher<MatcherRHS>::value, Detail::MatchAllOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>>
std::enable_if_t<Detail::is_generic_matcher_v<MatcherRHS>, Detail::MatchAllOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>>
operator && (MatcherBase<ArgLHS> const& lhs, MatcherRHS const& rhs) {
return { lhs, rhs };
}
template<typename MatcherLHS, typename ArgRHS>
std::enable_if_t<Detail::is_generic_matcher<MatcherLHS>::value, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>>
std::enable_if_t<Detail::is_generic_matcher_v<MatcherLHS>, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>>
operator || (MatcherLHS const& lhs, MatcherBase<ArgRHS> const& rhs) {
return { lhs, rhs };
}
template<typename ArgLHS, typename MatcherRHS>
std::enable_if_t<Detail::is_generic_matcher<MatcherRHS>::value, Detail::MatchAnyOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>>
std::enable_if_t<Detail::is_generic_matcher_v<MatcherRHS>, Detail::MatchAnyOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>>
operator || (MatcherBase<ArgLHS> const& lhs, MatcherRHS const& rhs) {
return { lhs, rhs };
}

View File

@@ -11,11 +11,9 @@ if (CATCH_BUILD_SURROGATES)
# Returns the path to the generated file.
function(createSurrogateFileTarget sourceHeader pathToFile)
set(pathPrefix ${PROJECT_SOURCE_DIR}/src)
file(RELATIVE_PATH includePath ${pathPrefix} ${sourceHeader})
get_filename_component(basicFileName "${sourceHeader}" NAME_WE)
set(surrogateFilePath ${CMAKE_CURRENT_BINARY_DIR}/surrogates/surrogate_${basicFileName}.cpp)
add_custom_command(
@@ -41,7 +39,6 @@ if (CATCH_BUILD_SURROGATES)
set(${OutArg} ${AllHeaders} PARENT_SCOPE)
endfunction()
ExtractCatch2Headers(mainHeaders)
if(NOT mainHeaders)
@@ -53,12 +50,10 @@ if (CATCH_BUILD_SURROGATES)
list(APPEND surrogateFiles ${pathToGeneratedFile})
endforeach()
add_executable(Catch2SurrogateTarget
${surrogateFiles}
)
target_link_libraries(Catch2SurrogateTarget PRIVATE Catch2WithMain)
endif()
####
@@ -67,12 +62,9 @@ endif()
# until 3.13 (not yet released)
####
if(MSVC)
configure_file(${CATCH_DIR}/tools/misc/SelfTest.vcxproj.user
${CMAKE_BINARY_DIR}/tests
COPYONLY)
configure_file(${CATCH_DIR}/tools/misc/SelfTest.vcxproj.user ${CMAKE_BINARY_DIR}/tests COPYONLY)
endif() #Temporary workaround
# define the sources of the self test
# Please keep these ordered alphabetically
set(TEST_SOURCES
@@ -142,7 +134,6 @@ set(TEST_HEADERS
${SELF_TEST_DIR}/helpers/type_with_lit_0_comparisons.hpp
)
# Specify the headers, too, so CLion recognises them as project files
set(HEADERS
${TOP_LEVEL_HEADERS}
@@ -154,8 +145,8 @@ set(HEADERS
)
# Provide some groupings for IDEs
#SOURCE_GROUP("benchmark" FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES})
#SOURCE_GROUP("Tests" FILES ${TEST_SOURCES})
#source_group("benchmark" FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES})
#source_group("Tests" FILES ${TEST_SOURCES})
include(CTest)
@@ -219,7 +210,6 @@ set_tests_properties(List::Tags::XmlOutput PROPERTIES
FAIL_REGULAR_EXPRESSION "[0-9]+ tags"
)
add_test(NAME List::Reporters::Output COMMAND $<TARGET_FILE:SelfTest> --list-reporters)
set_tests_properties(List::Reporters::Output PROPERTIES PASS_REGULAR_EXPRESSION "Available reporters:")
add_test(NAME List::Reporters::ExitCode COMMAND $<TARGET_FILE:SelfTest> --list-reporters)
@@ -447,7 +437,6 @@ set_tests_properties("Benchmarking::SkipBenchmarkMacros"
FAIL_REGULAR_EXPRESSION "benchmark name"
)
add_test(NAME "Benchmarking::FailureReporting::OptimizedOut"
COMMAND
$<TARGET_FILE:SelfTest> "Failing benchmarks" -c "empty" -r xml
@@ -611,7 +600,6 @@ set_tests_properties("Reporters::JUnit::NamespacesAreNormalized"
if(CATCH_ENABLE_CONFIGURE_TESTS)
foreach(testName "DefaultReporter" "Disable" "DisableStringification"
"ExperimentalRedirect")
add_test(NAME "CMakeConfig::${testName}"
COMMAND
"${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/TestScripts/testConfigure${testName}.py" "${CATCH_DIR}" "${CMAKE_CURRENT_BINARY_DIR}"
@@ -621,7 +609,6 @@ if (CATCH_ENABLE_CONFIGURE_TESTS)
COST 240
LABELS "uses-python"
)
endforeach()
endif()
@@ -646,7 +633,6 @@ foreach (reporterName # "Automake" - the simple .trs format does not support any
# "TeamCity" - does not seem to support test suite-level metadata/comments
"XML"
"JSON")
add_test(NAME "Reporters:Filters:${reporterName}"
COMMAND
$<TARGET_FILE:SelfTest> [comparisons][string-case] "CaseInsensitiveLess is case insensitive"
@@ -675,9 +661,7 @@ foreach (reporterName # "Automake" - the simple .trs format does not support any
PROPERTIES
PASS_REGULAR_EXPRESSION "18181818"
)
endforeach()
list(APPEND CATCH_WARNING_TARGETS SelfTest)
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)

View File

@@ -1,9 +1,4 @@
#
# Build extra tests.
#
cmake_minimum_required(VERSION 3.16)
project(Catch2ExtraTests LANGUAGES CXX)
message(STATUS "Extra tests included")
@@ -21,8 +16,7 @@ add_test(
NAME TestSharding::OverlyLargeShardIndex
COMMAND $<TARGET_FILE:SelfTest> --shard-index 5 --shard-count 5
)
set_tests_properties(
TestSharding::OverlyLargeShardIndex
set_tests_properties(TestSharding::OverlyLargeShardIndex
PROPERTIES
PASS_REGULAR_EXPRESSION "The shard count \\(5\\) must be greater than the shard index \\(5\\)"
)
@@ -31,8 +25,7 @@ set_tests_properties(
# they have non-trivial execution time, so they are categorized as
# extra tests, so that they are run less.
add_test(NAME MinDuration::SimpleThreshold COMMAND $<TARGET_FILE:SelfTest> --min-duration 0.950 [min_duration_test])
set_tests_properties(
MinDuration::SimpleThreshold
set_tests_properties(MinDuration::SimpleThreshold
PROPERTIES
PASS_REGULAR_EXPRESSION "s: sleep_for_1000ms"
FAIL_REGULAR_EXPRESSION "sleep_for_100ms"
@@ -43,8 +36,7 @@ set_tests_properties(
# -d yes overrides the threshold, so we should see the faster test even
# with a ridiculous high min duration threshold
add_test(NAME MinDuration::DurationOverrideYes COMMAND $<TARGET_FILE:SelfTest> --min-duration 1.0 -d yes [min_duration_test])
set_tests_properties(
MinDuration::DurationOverrideYes
set_tests_properties(MinDuration::DurationOverrideYes
PROPERTIES
PASS_REGULAR_EXPRESSION "s: sleep_for_100ms"
)
@@ -52,13 +44,11 @@ set_tests_properties(
# -d no overrides the threshold, so we should never see any tests even
# with ridiculously low min duration threshold
add_test(NAME MinDuration::DurationOverrideNo COMMAND $<TARGET_FILE:SelfTest> --min-duration 0.0001 -d no [min_duration_test])
set_tests_properties(
MinDuration::DurationOverrideNo
set_tests_properties(MinDuration::DurationOverrideNo
PROPERTIES
FAIL_REGULAR_EXPRESSION "sleep_for_250ms"
)
# ------------ end of duration reporting tests
# define folders used:
@@ -71,8 +61,7 @@ target_compile_definitions( PrefixedMacros PRIVATE CATCH_CONFIG_PREFIX_ALL CATCH
target_link_libraries(PrefixedMacros Catch2WithMain)
add_test(NAME CATCH_CONFIG_PREFIX_ALL COMMAND PrefixedMacros -s)
set_tests_properties(
CATCH_CONFIG_PREFIX_ALL
set_tests_properties(CATCH_CONFIG_PREFIX_ALL
PROPERTIES
PASS_REGULAR_EXPRESSION "CATCH_"
FAIL_REGULAR_EXPRESSION
@@ -81,7 +70,6 @@ set_tests_properties(
" REQUIRE; REQUIRE_FALSE; REQUIRE_THROWS; REQUIRE_THROWS_AS; REQUIRE_THROWS_WITH; REQUIRE_THROWS_MATCHES; REQUIRE_NOTHROW; CHECK; CHECK_FALSE; CHECKED_IF; CHECKED_ELSE; CHECK_NOFAIL; CHECK_THROWS; CHECK_THROWS_AS; CHECK_THROWS_WITH; CHECK_THROWS_MATCHES; CHECK_NOTHROW; REQUIRE_THAT; CHECK_THAT"
)
add_executable(DisabledMacros ${TESTS_DIR}/X02-DisabledMacros.cpp)
target_compile_definitions(DisabledMacros PRIVATE CATCH_CONFIG_DISABLE)
# Macro configuration does not touch the compiled parts, so we can link
@@ -89,15 +77,13 @@ target_compile_definitions( DisabledMacros PRIVATE CATCH_CONFIG_DISABLE )
target_link_libraries(DisabledMacros Catch2WithMain)
add_test(NAME CATCH_CONFIG_DISABLE-1 COMMAND DisabledMacros -s)
set_tests_properties(
CATCH_CONFIG_DISABLE-1
set_tests_properties(CATCH_CONFIG_DISABLE-1
PROPERTIES
PASS_REGULAR_EXPRESSION "No tests ran"
FAIL_REGULAR_EXPRESSION "This should not happen"
)
add_test(NAME CATCH_CONFIG_DISABLE-2 COMMAND DisabledMacros --list-tests)
set_tests_properties(
CATCH_CONFIG_DISABLE-2
set_tests_properties(CATCH_CONFIG_DISABLE-2
PROPERTIES
PASS_REGULAR_EXPRESSION "0 test cases"
)
@@ -117,8 +103,7 @@ target_compile_definitions( DisabledExceptions-CustomHandler PUBLIC CATCH_CONFIG
add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-1 COMMAND DisabledExceptions-DefaultHandler "Tests that run")
set_tests_properties(
CATCH_CONFIG_DISABLE_EXCEPTIONS-1
set_tests_properties(CATCH_CONFIG_DISABLE_EXCEPTIONS-1
PROPERTIES
PASS_REGULAR_EXPRESSION "assertions: 4 \| 2 passed \| 2 failed"
FAIL_REGULAR_EXPRESSION "abort;terminate;fatal"
@@ -159,7 +144,6 @@ set_tests_properties(BazelEnv::TESTBRIDGE_TEST_ONLY
PASS_REGULAR_EXPRESSION "All tests passed \\(1 assertion in 1 test case\\)"
)
add_test(NAME BazelEnv::Sharding
COMMAND
"${PYTHON_EXECUTABLE}" "${CATCH_DIR}/tests/TestScripts/testBazelSharding.py"
@@ -171,72 +155,60 @@ set_tests_properties(BazelEnv::Sharding
LABELS "uses-python"
)
# The default handler on Windows leads to the just-in-time debugger firing,
# which makes this test unsuitable for CI and headless runs, as it opens
# up an interactive dialog.
if(NOT WIN32)
add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-2 COMMAND DisabledExceptions-DefaultHandler "Tests that abort")
set_tests_properties(
CATCH_CONFIG_DISABLE_EXCEPTIONS-2
set_tests_properties(CATCH_CONFIG_DISABLE_EXCEPTIONS-2
PROPERTIES
PASS_REGULAR_EXPRESSION "Catch will terminate"
)
endif()
add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-3 COMMAND DisabledExceptions-CustomHandler "Tests that run")
set_tests_properties(
CATCH_CONFIG_DISABLE_EXCEPTIONS-3
set_tests_properties(CATCH_CONFIG_DISABLE_EXCEPTIONS-3
PROPERTIES
PASS_REGULAR_EXPRESSION "assertions: 4 \| 2 passed \| 2 failed"
FAIL_REGULAR_EXPRESSION "====== CUSTOM HANDLER ======"
)
add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-4 COMMAND DisabledExceptions-CustomHandler "Tests that abort")
set_tests_properties(
CATCH_CONFIG_DISABLE_EXCEPTIONS-4
set_tests_properties(CATCH_CONFIG_DISABLE_EXCEPTIONS-4
PROPERTIES
PASS_REGULAR_EXPRESSION "====== CUSTOM HANDLER ======"
)
add_executable(DeferredStaticChecks ${TESTS_DIR}/X05-DeferredStaticChecks.cpp)
target_link_libraries(DeferredStaticChecks PRIVATE Catch2WithMain)
target_compile_definitions(DeferredStaticChecks PRIVATE "CATCH_CONFIG_RUNTIME_STATIC_REQUIRE")
add_test(NAME DeferredStaticChecks COMMAND DeferredStaticChecks -r compact)
set_tests_properties(
DeferredStaticChecks
set_tests_properties(DeferredStaticChecks
PROPERTIES
PASS_REGULAR_EXPRESSION "test cases: 1 \\| 1 failed\nassertions: 3 \\| 3 failed"
)
add_executable(FallbackStringifier ${TESTS_DIR}/X10-FallbackStringifier.cpp)
target_compile_definitions(FallbackStringifier PRIVATE CATCH_CONFIG_FALLBACK_STRINGIFIER=fallbackStringifier)
target_link_libraries(FallbackStringifier Catch2WithMain)
add_test(NAME FallbackStringifier COMMAND FallbackStringifier -r compact -s)
set_tests_properties(
FallbackStringifier
set_tests_properties(FallbackStringifier
PROPERTIES
PASS_REGULAR_EXPRESSION "foo{} for: { !!! }"
)
add_executable(DisableStringification ${TESTS_DIR}/X11-DisableStringification.cpp)
target_compile_definitions(DisableStringification PRIVATE CATCH_CONFIG_DISABLE_STRINGIFICATION)
target_link_libraries(DisableStringification Catch2WithMain)
add_test(NAME CATCH_CONFIG_DISABLE_STRINGIFICATION COMMAND DisableStringification -r compact -s)
set_tests_properties(
CATCH_CONFIG_DISABLE_STRINGIFICATION
set_tests_properties(CATCH_CONFIG_DISABLE_STRINGIFICATION
PROPERTIES
PASS_REGULAR_EXPRESSION "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
FAIL_REGULAR_EXPRESSION "Hidden{} == Hidden{}"
)
# This test touches windows.h, so it should only be compiled under msvc
if(MSVC)
# This test fails if it does not compile and succeeds otherwise
@@ -246,7 +218,6 @@ if (MSVC)
list(APPEND CATCH_WARNING_TARGETS ${EXTRA_TEST_BINARIES} WindowsHeader)
endif()
add_executable(PartialTestCaseEvents ${TESTS_DIR}/X21-PartialTestCaseEvents.cpp)
target_link_libraries(PartialTestCaseEvents PRIVATE Catch2WithMain)
add_test(
@@ -264,22 +235,19 @@ add_test(
NAME BenchmarksInCumulativeReporter
COMMAND BenchmarksInCumulativeReporter --reporter testReporter
)
set_tests_properties(
BenchmarksInCumulativeReporter
set_tests_properties(BenchmarksInCumulativeReporter
PROPERTIES
PASS_REGULAR_EXPRESSION "1\n2\n3\n4\n5\n"
COST 30
)
add_executable(CasingInReporterNames ${TESTS_DIR}/X23-CasingInReporterNames.cpp)
target_link_libraries(CasingInReporterNames PRIVATE Catch2::Catch2WithMain)
add_test(
NAME Reporters::registration-is-case-preserving
COMMAND CasingInReporterNames --list-reporters
)
set_tests_properties(
Reporters::registration-is-case-preserving
set_tests_properties(Reporters::registration-is-case-preserving
PROPERTIES
PASS_REGULAR_EXPRESSION "testReporterCASED"
)
@@ -287,8 +255,7 @@ add_test(
NAME Reporters::selection-is-case-insensitive
COMMAND CasingInReporterNames -r testReportercased
)
set_tests_properties(
Reporters::selection-is-case-insensitive
set_tests_properties(Reporters::selection-is-case-insensitive
PROPERTIES
PASS_REGULAR_EXPRESSION "TestReporter constructed"
)
@@ -300,14 +267,12 @@ add_test(
COMMAND CapturedStdoutInTestCaseEvents
--reporter test-reporter
)
set_tests_properties(
Reporters::CapturedStdOutInEvents
set_tests_properties(Reporters::CapturedStdOutInEvents
PROPERTIES
PASS_REGULAR_EXPRESSION "X27 - TestReporter constructed"
FAIL_REGULAR_EXPRESSION "X27 ERROR"
)
if(MSVC)
set(_NullFile "NUL")
else()
@@ -328,15 +293,13 @@ if (NOT MEMORYCHECK_COMMAND)
--reporter junit::out=${_NullFile}
)
set_tests_properties(
MultiReporter::NoncapturingListenerDoesntCauseStdoutPassThrough
set_tests_properties(MultiReporter::NoncapturingListenerDoesntCauseStdoutPassThrough
PROPERTIES
PASS_REGULAR_EXPRESSION "X24 - NonCapturingListener initialized"
FAIL_REGULAR_EXPRESSION "X24 - FooBarBaz"
)
endif()
add_executable(ListenerCanAskForCapturedStdout ${TESTS_DIR}/X25-ListenerCanAskForCapturedStdout.cpp)
target_link_libraries(ListenerCanAskForCapturedStdout PRIVATE Catch2::Catch2WithMain)
add_test(
@@ -345,8 +308,7 @@ add_test(
--reporter compact::out=${_NullFile}
--reporter console::out=${_NullFile}
)
set_tests_properties(
MultiReporter::CapturingListenerCausesStdoutCapture
set_tests_properties(MultiReporter::CapturingListenerCausesStdoutCapture
PROPERTIES
PASS_REGULAR_EXPRESSION "CapturingListener initialized"
FAIL_REGULAR_EXPRESSION "X25 - ERROR"
@@ -359,8 +321,7 @@ add_test(
COMMAND ReporterPreferencesForPassingAssertionsIsRespected
--reporter test-reporter
)
set_tests_properties(
Reporters::PreferencesForPassingAssertionsIsRespected
set_tests_properties(Reporters::PreferencesForPassingAssertionsIsRespected
PROPERTIES
PASS_REGULAR_EXPRESSION "X26 - TestReporter constructed"
FAIL_REGULAR_EXPRESSION "X26 - assertionEnded"
@@ -371,8 +332,7 @@ add_test(
--reporter test-reporter
--reporter console::out=${_NullFile}
)
set_tests_properties(
MultiReporter::PreferencesForPassingAssertionsIsRespected
set_tests_properties(MultiReporter::PreferencesForPassingAssertionsIsRespected
PROPERTIES
PASS_REGULAR_EXPRESSION "X26 - TestReporter constructed"
FAIL_REGULAR_EXPRESSION "X26 - assertionEnded"
@@ -384,8 +344,7 @@ add_test(
NAME ListenersGetEventsBeforeReporters
COMMAND ListenersGetEventsBeforeReporters --reporter test-reporter
)
set_tests_properties(
ListenersGetEventsBeforeReporters
set_tests_properties(ListenersGetEventsBeforeReporters
PROPERTIES
PASS_REGULAR_EXPRESSION "X28 - TestReporter constructed"
FAIL_REGULAR_EXPRESSION "X28 - ERROR"
@@ -398,21 +357,18 @@ add_test(
COMMAND CustomArgumentsForReporters
--reporter "test-reporter::Xa b=c 1::Xz:e = 1234"
)
set_tests_properties(
CustomArgumentsForReporters
set_tests_properties(CustomArgumentsForReporters
PROPERTIES
PASS_REGULAR_EXPRESSION "Xa b=c 1::Xz:e = 1234"
)
add_executable(DuplicatedTestCases-SameNameAndTags ${TESTS_DIR}/X31-DuplicatedTestCases.cpp)
target_link_libraries(DuplicatedTestCases-SameNameAndTags PRIVATE Catch2::Catch2WithMain)
add_test(
NAME DuplicatedTestCases::SameNameAndTags
COMMAND $<TARGET_FILE:DuplicatedTestCases-SameNameAndTags>
)
set_tests_properties(
DuplicatedTestCases::SameNameAndTags
set_tests_properties(DuplicatedTestCases::SameNameAndTags
PROPERTIES
PASS_REGULAR_EXPRESSION "error: .* already defined\\."
)
@@ -423,8 +379,7 @@ add_test(
NAME DuplicatedTestCases::SameNameDifferentTags
COMMAND $<TARGET_FILE:DuplicatedTestCases-SameNameDifferentTags>
)
set_tests_properties(
DuplicatedTestCases::SameNameDifferentTags
set_tests_properties(DuplicatedTestCases::SameNameDifferentTags
PROPERTIES
FAIL_REGULAR_EXPRESSION "error: .* already defined\\."
)
@@ -435,8 +390,7 @@ add_test(
NAME DuplicatedTestCases::DuplicatedTestCaseMethods
COMMAND $<TARGET_FILE:DuplicatedTestCases-DuplicatedTestCaseMethods>
)
set_tests_properties(
DuplicatedTestCases::DuplicatedTestCaseMethods
set_tests_properties(DuplicatedTestCases::DuplicatedTestCaseMethods
PROPERTIES
PASS_REGULAR_EXPRESSION "error: .* already defined\\."
)
@@ -447,21 +401,18 @@ add_test(
NAME DuplicatedTestCases::DuplicatedTestCaseMethodsDifferentFixtures
COMMAND $<TARGET_FILE:DuplicatedTestCases-DifferentFixtures>
)
set_tests_properties(
DuplicatedTestCases::DuplicatedTestCaseMethodsDifferentFixtures
set_tests_properties(DuplicatedTestCases::DuplicatedTestCaseMethodsDifferentFixtures
PROPERTIES
FAIL_REGULAR_EXPRESSION "error: .* already defined\\."
)
add_executable(DuplicatedReporters ${TESTS_DIR}/X35-DuplicatedReporterNames.cpp)
target_link_libraries(DuplicatedReporters PRIVATE Catch2::Catch2WithMain)
add_test(
NAME Reporters::RegistrationErrorsAreCaught
COMMAND $<TARGET_FILE:DuplicatedReporters>
)
set_tests_properties(
Reporters::RegistrationErrorsAreCaught
set_tests_properties(Reporters::RegistrationErrorsAreCaught
PROPERTIES
PASS_REGULAR_EXPRESSION "Errors occurred during startup!"
)
@@ -472,8 +423,7 @@ add_test(
NAME Reporters::CrashInJunitReporter
COMMAND ${CMAKE_COMMAND} -E env $<TARGET_FILE:ReportingCrashWithJunitReporter> --reporter JUnit
)
set_tests_properties(
Reporters::CrashInJunitReporter
set_tests_properties(Reporters::CrashInJunitReporter
PROPERTIES
PASS_REGULAR_EXPRESSION "</testsuites>"
LABELS "uses-signals"
@@ -493,8 +443,7 @@ add_test(
#add_executable(DebugBreakMacros ${TESTS_DIR}/X12-CustomDebugBreakMacro.cpp)
#target_link_libraries(DebugBreakMacros Catch2)
#add_test(NAME DebugBreakMacros COMMAND DebugBreakMacros --break)
#set_tests_properties(
# DebugBreakMacros
#set_tests_properties(DebugBreakMacros
# PROPERTIES
# PASS_REGULAR_EXPRESSION "Pretty please, break into debugger"
#)
@@ -521,7 +470,6 @@ add_test(
COMMAND $<TARGET_FILE:NoTests> --list-listeners
)
add_executable(AllSkipped ${TESTS_DIR}/X93-AllSkipped.cpp)
target_link_libraries(AllSkipped PRIVATE Catch2::Catch2WithMain)
@@ -557,7 +505,6 @@ list(FILTER EXTRA_TEST_BINARIES EXCLUDE REGEX "DisabledExceptions.*")
list(APPEND CATCH_WARNING_TARGETS ${EXTRA_TEST_BINARIES})
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)
# This sets up a one-off executable that compiles against the amalgamated
# files, and then runs it for a super simple check that the amalgamated
# files are usable.
@@ -570,8 +517,7 @@ target_include_directories(AmalgamatedTestCompilation PRIVATE ${CATCH_DIR}/extra
target_compile_features(AmalgamatedTestCompilation PRIVATE cxx_std_14)
add_test(NAME AmalgamatedFileTest COMMAND AmalgamatedTestCompilation)
set_tests_properties(
AmalgamatedFileTest
set_tests_properties(AmalgamatedFileTest
PROPERTIES
PASS_REGULAR_EXPRESSION "All tests passed \\(14 assertions in 3 test cases\\)"
)

View File

@@ -175,7 +175,7 @@ Nor would this
:test-result: XFAIL Inequality checks that should fail
:test-result: PASS Inequality checks that should succeed
:test-result: PASS JsonWriter
:test-result: PASS JsonWriter escapes charaters in strings properly
:test-result: PASS JsonWriter escapes characters in strings properly
:test-result: PASS Lambdas in assertions
:test-result: PASS Less-than inequalities with different epsilons
:test-result: PASS ManuallyRegistered

View File

@@ -173,7 +173,7 @@
:test-result: XFAIL Inequality checks that should fail
:test-result: PASS Inequality checks that should succeed
:test-result: PASS JsonWriter
:test-result: PASS JsonWriter escapes charaters in strings properly
:test-result: PASS JsonWriter escapes characters in strings properly
:test-result: PASS Lambdas in assertions
:test-result: PASS Less-than inequalities with different epsilons
:test-result: PASS ManuallyRegistered

View File

@@ -7652,7 +7652,7 @@ with expansion:
""custom"" == ""custom""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Quote in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7664,7 +7664,7 @@ with expansion:
""\""" == ""\"""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Backslash in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7676,7 +7676,7 @@ with expansion:
""\\"" == ""\\""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Forward slash in a string is **not** escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7688,7 +7688,7 @@ with expansion:
""/"" == ""/""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Backspace in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7700,7 +7700,7 @@ with expansion:
""\b"" == ""\b""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Formfeed in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7712,7 +7712,7 @@ with expansion:
""\f"" == ""\f""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
linefeed in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7724,7 +7724,7 @@ with expansion:
""\n"" == ""\n""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
carriage return in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7736,7 +7736,7 @@ with expansion:
""\r"" == ""\r""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
tab in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7748,7 +7748,7 @@ with expansion:
""\t"" == ""\t""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
combination of characters is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>

View File

@@ -7650,7 +7650,7 @@ with expansion:
""custom"" == ""custom""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Quote in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7662,7 +7662,7 @@ with expansion:
""\""" == ""\"""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Backslash in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7674,7 +7674,7 @@ with expansion:
""\\"" == ""\\""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Forward slash in a string is **not** escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7686,7 +7686,7 @@ with expansion:
""/"" == ""/""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Backspace in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7698,7 +7698,7 @@ with expansion:
""\b"" == ""\b""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
Formfeed in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7710,7 +7710,7 @@ with expansion:
""\f"" == ""\f""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
linefeed in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7722,7 +7722,7 @@ with expansion:
""\n"" == ""\n""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
carriage return in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7734,7 +7734,7 @@ with expansion:
""\r"" == ""\r""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
tab in a string is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>
@@ -7746,7 +7746,7 @@ with expansion:
""\t"" == ""\t""
-------------------------------------------------------------------------------
JsonWriter escapes charaters in strings properly
JsonWriter escapes characters in strings properly
combination of characters is escaped
-------------------------------------------------------------------------------
Json.tests.cpp:<line number>

View File

@@ -929,16 +929,16 @@ at Condition.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="JsonWriter/Moved from JsonObjectWriter shall not insert superfluous brace" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter/Moved from JsonArrayWriter shall not insert superfluous bracket" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter/Custom class shall be quoted" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Quote in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Backslash in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Forward slash in a string is **not** escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Backspace in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Formfeed in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/linefeed in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/carriage return in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/tab in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/combination of characters is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Quote in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Backslash in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Forward slash in a string is **not** escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Backspace in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Formfeed in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/linefeed in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/carriage return in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/tab in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/combination of characters is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Lambdas in assertions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Less-than inequalities with different epsilons" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ManuallyRegistered" time="{duration}" status="run"/>

View File

@@ -928,16 +928,16 @@ at Condition.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="JsonWriter/Moved from JsonObjectWriter shall not insert superfluous brace" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter/Moved from JsonArrayWriter shall not insert superfluous bracket" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter/Custom class shall be quoted" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Quote in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Backslash in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Forward slash in a string is **not** escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Backspace in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Formfeed in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/linefeed in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/carriage return in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/tab in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/combination of characters is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Quote in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Backslash in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Forward slash in a string is **not** escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Backspace in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/Formfeed in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/linefeed in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/carriage return in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/tab in a string is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="JsonWriter escapes characters in strings properly/combination of characters is escaped" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Lambdas in assertions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Less-than inequalities with different epsilons" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ManuallyRegistered" time="{duration}" status="run"/>

View File

@@ -173,16 +173,16 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="JsonWriter/Moved from JsonObjectWriter shall not insert superfluous brace" duration="{duration}"/>
<testCase name="JsonWriter/Moved from JsonArrayWriter shall not insert superfluous bracket" duration="{duration}"/>
<testCase name="JsonWriter/Custom class shall be quoted" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Quote in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Backslash in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Forward slash in a string is **not** escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Backspace in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Formfeed in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/linefeed in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/carriage return in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/tab in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/combination of characters is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Quote in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Backslash in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Forward slash in a string is **not** escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Backspace in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Formfeed in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/linefeed in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/carriage return in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/tab in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/combination of characters is escaped" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/Parse.tests.cpp">
<testCase name="Parse uints" duration="{duration}"/>

View File

@@ -172,16 +172,16 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="JsonWriter/Moved from JsonObjectWriter shall not insert superfluous brace" duration="{duration}"/>
<testCase name="JsonWriter/Moved from JsonArrayWriter shall not insert superfluous bracket" duration="{duration}"/>
<testCase name="JsonWriter/Custom class shall be quoted" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Quote in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Backslash in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Forward slash in a string is **not** escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Backspace in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/Formfeed in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/linefeed in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/carriage return in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/tab in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes charaters in strings properly/combination of characters is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Quote in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Backslash in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Forward slash in a string is **not** escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Backspace in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/Formfeed in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/linefeed in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/carriage return in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/tab in a string is escaped" duration="{duration}"/>
<testCase name="JsonWriter escapes characters in strings properly/combination of characters is escaped" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/Parse.tests.cpp">
<testCase name="Parse uints" duration="{duration}"/>

View File

@@ -1904,23 +1904,23 @@ ok {test-number} - stream.str() == "{\n}" for: "{ }" == "{ }"
ok {test-number} - stream.str() == "[\n]" for: "[ ]" == "[ ]"
# JsonWriter
ok {test-number} - stream.str() == "\"custom\"" for: ""custom"" == ""custom""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\\"\"" for: ""\""" == ""\"""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\\\\"" for: ""\\"" == ""\\""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"/\"" for: ""/"" == ""/""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\b\"" for: ""\b"" == ""\b""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\f\"" for: ""\f"" == ""\f""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\n\"" for: ""\n"" == ""\n""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\r\"" for: ""\r"" == ""\r""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\t\"" for: ""\t"" == ""\t""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\\\/\\t\\r\\n\"" for: ""\\/\t\r\n"" == ""\\/\t\r\n""
# Lambdas in assertions
ok {test-number} - []() { return true; }() for: true

View File

@@ -1902,23 +1902,23 @@ ok {test-number} - stream.str() == "{\n}" for: "{ }" == "{ }"
ok {test-number} - stream.str() == "[\n]" for: "[ ]" == "[ ]"
# JsonWriter
ok {test-number} - stream.str() == "\"custom\"" for: ""custom"" == ""custom""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\\"\"" for: ""\""" == ""\"""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\\\\"" for: ""\\"" == ""\\""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"/\"" for: ""/"" == ""/""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\b\"" for: ""\b"" == ""\b""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\f\"" for: ""\f"" == ""\f""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\n\"" for: ""\n"" == ""\n""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\r\"" for: ""\r"" == ""\r""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\t\"" for: ""\t"" == ""\t""
# JsonWriter escapes charaters in strings properly
# JsonWriter escapes characters in strings properly
ok {test-number} - sstream.str() == "\"\\\\/\\t\\r\\n\"" for: ""\\/\t\r\n"" == ""\\/\t\r\n""
# Lambdas in assertions
ok {test-number} - []() { return true; }() for: true

View File

@@ -431,8 +431,8 @@
##teamcity[testFinished name='Inequality checks that should succeed' duration="{duration}"]
##teamcity[testStarted name='JsonWriter']
##teamcity[testFinished name='JsonWriter' duration="{duration}"]
##teamcity[testStarted name='JsonWriter escapes charaters in strings properly']
##teamcity[testFinished name='JsonWriter escapes charaters in strings properly' duration="{duration}"]
##teamcity[testStarted name='JsonWriter escapes characters in strings properly']
##teamcity[testFinished name='JsonWriter escapes characters in strings properly' duration="{duration}"]
##teamcity[testStarted name='Lambdas in assertions']
##teamcity[testFinished name='Lambdas in assertions' duration="{duration}"]
##teamcity[testStarted name='Less-than inequalities with different epsilons']

View File

@@ -431,8 +431,8 @@
##teamcity[testFinished name='Inequality checks that should succeed' duration="{duration}"]
##teamcity[testStarted name='JsonWriter']
##teamcity[testFinished name='JsonWriter' duration="{duration}"]
##teamcity[testStarted name='JsonWriter escapes charaters in strings properly']
##teamcity[testFinished name='JsonWriter escapes charaters in strings properly' duration="{duration}"]
##teamcity[testStarted name='JsonWriter escapes characters in strings properly']
##teamcity[testFinished name='JsonWriter escapes characters in strings properly' duration="{duration}"]
##teamcity[testStarted name='Lambdas in assertions']
##teamcity[testFinished name='Lambdas in assertions' duration="{duration}"]
##teamcity[testStarted name='Less-than inequalities with different epsilons']

View File

@@ -9158,7 +9158,7 @@ Approx( 3.14150000000000018 )
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="JsonWriter escapes charaters in strings properly" tags="[JsonWriter]" filename="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp" >
<TestCase name="JsonWriter escapes characters in strings properly" tags="[JsonWriter]" filename="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp" >
<Section name="Quote in a string is escaped" filename="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp" >
<Original>

View File

@@ -9158,7 +9158,7 @@ Approx( 3.14150000000000018 )
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="JsonWriter escapes charaters in strings properly" tags="[JsonWriter]" filename="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp" >
<TestCase name="JsonWriter escapes characters in strings properly" tags="[JsonWriter]" filename="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp" >
<Section name="Quote in a string is escaped" filename="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp" >
<Original>

View File

@@ -22,7 +22,7 @@ namespace {
ExtendedMultResult<Int>{ upper_result, lower_result } );
}
// Simple (and slow) implmentation of extended multiplication for tests
// Simple (and slow) implementation of extended multiplication for tests
constexpr Catch::Detail::ExtendedMultResult<std::uint64_t>
extendedMultNaive( std::uint64_t lhs, std::uint64_t rhs ) {
// This is a simple long multiplication, where we split lhs and rhs

View File

@@ -111,7 +111,7 @@ TEST_CASE( "JsonWriter", "[JSON][JsonWriter]" ) {
}
}
TEST_CASE( "JsonWriter escapes charaters in strings properly", "[JsonWriter]" ) {
TEST_CASE( "JsonWriter escapes characters in strings properly", "[JsonWriter]" ) {
std::stringstream sstream;
SECTION( "Quote in a string is escaped" ) {
Catch::JsonValueWriter{ sstream }.write( "\"" );

View File

@@ -15,7 +15,7 @@ import subprocess
def configure_and_build(source_path: str, project_path: str, options: List[Tuple[str, str]]):
base_configure_cmd = ['cmake',
'-B{}'.format(project_path),
'-H{}'.format(source_path),
'-S{}'.format(source_path),
'-DCMAKE_BUILD_TYPE=Debug',
'-DCATCH_DEVELOPMENT_BUILD=ON']
for option, value in options:

View File

@@ -1,13 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(discover-tests-test LANGUAGES CXX)
project(discover-tests-test
LANGUAGES CXX
)
add_executable(tests
register-tests.cpp
)
add_executable(tests register-tests.cpp)
add_subdirectory(${CATCH2_PATH} catch2-build)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)

View File

@@ -46,10 +46,15 @@ env["TEST_SHARD_INDEX"] = "0"
env["TEST_TOTAL_SHARDS"] = "2"
env["TEST_SHARD_STATUS_FILE"] = info_file_path
cmd = [
bin_path,
# We rely on the test order being deterministic
'--order', 'decl'
]
try:
ret = subprocess.run(
bin_path,
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=True,

View File

@@ -1,11 +1,8 @@
cmake_minimum_required(VERSION 3.16)
project(CatchCoverageHelper)
project(CatchCoverageHelper LANGUAGES CXX)
add_executable(CoverageHelper coverage-helper.cpp)
set_property(TARGET CoverageHelper PROPERTY CXX_STANDARD 11)
set_property(TARGET CoverageHelper PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET CoverageHelper PROPERTY CXX_EXTENSIONS OFF)
target_compile_features(CoverageHelper PRIVATE cxx_std_11)
if(MSVC)
target_compile_options(CoverageHelper PRIVATE /W4 /w44265 /WX /w44061 /w44062)
endif()

View File

@@ -8,14 +8,14 @@ SETLOCAL EnableDelayedExpansion
if "%CONFIGURATION%"=="Debug" (
if "%coverage%"=="1" (
@REM # coverage needs to build the special helper as well as the main
cmake -Htools/misc -Bbuild-misc -A%PLATFORM% || exit /b !ERRORLEVEL!
cmake -Stools/misc -Bbuild-misc -A%PLATFORM% || exit /b !ERRORLEVEL!
cmake --build build-misc || exit /b !ERRORLEVEL!
cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_ENABLE_CONFIGURE_TESTS=%configure_tests% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL!
cmake -S. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_ENABLE_CONFIGURE_TESTS=%configure_tests% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL!
) else (
@REM # We know that coverage is 0
cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_BUILD_SURROGATES=%surrogates% -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_ENABLE_CONFIGURE_TESTS=%configure_tests% || exit /b !ERRORLEVEL!
cmake -S. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_BUILD_SURROGATES=%surrogates% -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_ENABLE_CONFIGURE_TESTS=%configure_tests% || exit /b !ERRORLEVEL!
)
)
if "%CONFIGURATION%"=="Release" (
cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL!
cmake -S. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL!
)