externals: Update catch2 to v3.5.0

Merge commit 'ba06a404d1'
This commit is contained in:
Yang Liu 2023-12-31 14:00:46 +08:00
commit b372dc6157
272 changed files with 22238 additions and 7949 deletions

View file

@ -48,11 +48,11 @@ def get_unapprovedResultsPath(baseName):
langFilenameParser = re.compile(r'(.+\.[ch]pp)')
filelocParser = re.compile(r'''
.*/
(.+\.[ch]pp) # filename
(?::|\() # : is starting separator between filename and line number on Linux, ( on Windows
([0-9]*) # line number
\)? # Windows also has an ending separator, )
(?P<path_prefix>tests/SelfTest/(?:\w+/)*) # We separate prefix and fname, so that
(?P<filename>\w+\.tests\.[ch]pp) # we can keep only filename
(?::|\() # Linux has : as separator between fname and line number, Windows uses (
(\d*) # line number
\)? # Windows also uses an ending separator, )
''', re.VERBOSE)
lineNumberParser = re.compile(r' line="[0-9]*"')
hexParser = re.compile(r'\b(0[xX][0-9a-fA-F]+)\b')
@ -119,14 +119,11 @@ def filterLine(line, isCompact):
line = normalizeFilepath(line)
# strip source line numbers
m = filelocParser.match(line)
if m:
# note that this also strips directories, leaving only the filename
filename, lnum = m.groups()
lnum = ":<line number>" if lnum else ""
line = filename + lnum + line[m.end():]
else:
line = lineNumberParser.sub(" ", line)
# Note that this parser assumes an already normalized filepath from above,
# and might break terribly if it is moved around before the normalization.
line = filelocParser.sub('\g<filename>:<line number>', line)
line = lineNumberParser.sub(" ", line)
if isCompact:
line = line.replace(': FAILED', ': failed')

View file

@ -6,7 +6,7 @@ rem 1. Regenerate the amalgamated distribution
python tools\scripts\generateAmalgamatedFiles.py
rem 2. Configure the full test build
cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_ENABLE_CONFIGURE_TESTS=ON
cmake -B debug-build -S . -DCMAKE_BUILD_TYPE=Debug --preset all-tests
rem 3. Run the actual build
cmake --build debug-build

View file

@ -8,7 +8,7 @@
./tools/scripts/generateAmalgamatedFiles.py
# 2. Configure the full test build
cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_ENABLE_CONFIGURE_TESTS=ON
cmake -B debug-build -S . -DCMAKE_BUILD_TYPE=Debug --preset all-tests
# 3. Run the actual build
cmake --build debug-build

View file

@ -33,7 +33,8 @@ def check_licences_in_path(path: str) -> int:
def check_licences():
failed = 0
roots = ['src/catch2', 'tests']
# Add 'extras' after the amalgamted files are regenerated with the new script (past 3.4.0)
roots = ['src/catch2', 'tests', 'examples', 'fuzzing']
for root in roots:
failed += check_licences_in_path(root)

View file

@ -1,4 +1,9 @@
#!/usr/bin/env python3
# Copyright Catch2 Authors
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)
# SPDX-License-Identifier: BSL-1.0
import os
import re
@ -12,6 +17,8 @@ starting_header = os.path.join(root_path, 'catch2', 'catch_all.hpp')
output_header = os.path.join(catchPath, 'extras', 'catch_amalgamated.hpp')
output_cpp = os.path.join(catchPath, 'extras', 'catch_amalgamated.cpp')
# REUSE-IgnoreStart
# These are the copyright comments in each file, we want to ignore them
copyright_lines = [
'// Copyright Catch2 Authors\n',
@ -24,6 +31,7 @@ copyright_lines = [
# The header of the amalgamated file: copyright information + explanation
# what this file is.
file_header = '''\
// Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at
@ -39,6 +47,8 @@ file_header = '''\
// ----------------------------------------------------------
'''
# REUSE-IgnoreEnd
# Returns file header with proper version string and generation time
def formatted_file_header(version):
return file_header.format(version_string=version.getVersionString(),

View file

@ -114,8 +114,8 @@ def updateVersionDefine(version):
def updateVersionPlaceholder(filename, version):
with open(filename, 'rb') as file:
lines = file.readlines()
placeholderRegex = re.compile(b'in Catch[0-9]? X.Y.Z')
replacement = 'in Catch2 {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii')
placeholderRegex = re.compile(b'Catch[0-9]? X.Y.Z')
replacement = 'Catch2 {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii')
with open(filename, 'wb') as file:
for line in lines:
file.write(placeholderRegex.sub(replacement, line))

View file

@ -287,7 +287,7 @@ def markdownToclify(
Path to the markdown output file.
min_toc_len: int (default: 2)
Miniumum number of entries to create a table of contents for.
Minimum number of entries to create a table of contents for.
github: bool (default: False)
Uses GitHub TOC syntax if True.