Skip to content

Commit

Permalink
Merge commit '6eeeacc036d80fbabbfcd6bd3e4a527ae4d8c2f5' into catch2-u…
Browse files Browse the repository at this point in the history
…pgrade
  • Loading branch information
FoamScience committed May 22, 2024
2 parents 09995de + 6eeeacc commit 91ce271
Show file tree
Hide file tree
Showing 286 changed files with 17,980 additions and 6,820 deletions.
1 change: 1 addition & 0 deletions catch2/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ build:vs2022 --cxxopt=/std:c++17

build:windows --config=vs2022
build:linux --config=gcc11
build:macos --cxxopt=-std=c++2b
81 changes: 81 additions & 0 deletions catch2/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# Note: Alas, `Checks` is a string, not an array.
# Comments in the block string are not parsed and are passed in the value.
# They must thus be delimited by ',' from either side - then they are
# harmless. It's terrible, but it works.
Checks: >-
clang-diagnostic-*,
clang-analyzer-*,
-clang-analyzer-optin.core.EnumCastOutOfRange,
bugprone-*,
-bugprone-unchecked-optional-access,
,# This is ridiculous, as it triggers on constants,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-easily-swappable-parameters,
,# Is not really useful, has false positives, triggers for no-noexcept move constructors ...,
-bugprone-exception-escape,
-bugprone-narrowing-conversions,
-bugprone-chained-comparison,# RIP decomposers,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-use-auto,
-modernize-use-emplace,
-modernize-use-nullptr,# it went crazy with three-way comparison operators,
-modernize-use-trailing-return-type,
-modernize-return-braced-init-list,
-modernize-concat-nested-namespaces,
-modernize-use-nodiscard,
-modernize-use-default-member-init,
-modernize-type-traits,# we need to support C++14,
-modernize-deprecated-headers,
,# There's a lot of these and most of them are probably not useful,
-modernize-pass-by-value,
performance-*,
-performance-enum-size,
portability-*,
readability-*,
-readability-braces-around-statements,
-readability-container-size-empty,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-qualified-auto,
-readability-redundant-access-specifiers,
-readability-simplify-boolean-expr,
-readability-static-definition-in-anonymous-namespace,
-readability-uppercase-literal-suffix,
-readability-use-anyofallof,
-readability-avoid-return-with-void-value,
,# time hogs,
-bugprone-throw-keyword-missing,
-modernize-replace-auto-ptr,
-readability-identifier-naming,
,# We cannot use this until clang-tidy supports custom unique_ptr,
-bugprone-use-after-move,
,# Doesn't recognize unevaluated context in CATCH_MOVE and CATCH_FORWARD,
-bugprone-macro-repeated-side-effects,
WarningsAsErrors: >-
clang-analyzer-core.*,
clang-analyzer-cplusplus.*,
clang-analyzer-security.*,
clang-analyzer-unix.*,
performance-move-const-arg,
performance-unnecessary-value-param,
readability-duplicate-include,
HeaderFilterRegex: '.*\.(c|cxx|cpp)$'
FormatStyle: none
CheckOptions: {}
...
16 changes: 6 additions & 10 deletions catch2/.conan/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
cmake_minimum_required(VERSION 3.2.0)
project(test_package CXX)
cmake_minimum_required(VERSION 3.15)
project(PackageTest CXX)

include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
find_package(Catch2 CONFIG REQUIRED)

find_package(Catch2 REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)

target_link_libraries(${PROJECT_NAME} Catch2::Catch2WithMain)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14)
add_executable(test_package test_package.cpp)
target_link_libraries(test_package Catch2::Catch2WithMain)
target_compile_features(test_package PRIVATE cxx_std_14)
32 changes: 26 additions & 6 deletions catch2/.conan/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
from conan.tools.build import can_run
from conan.tools.files import save, load
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_find_package_multi", "cmake"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"

def requirements(self):
self.requires(self.tested_reference_str)

def layout(self):
cmake_layout(self)

def generate(self):
save(self, os.path.join(self.build_folder, "package_folder"),
self.dependencies[self.tested_reference_str].package_folder)
save(self, os.path.join(self.build_folder, "license"),
self.dependencies[self.tested_reference_str].license)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
assert os.path.isfile(os.path.join(
self.deps_cpp_info["catch2"].rootpath, "licenses", "LICENSE.txt"))
bin_path = os.path.join("bin", "test_package")
self.run("%s -s" % bin_path, run_environment=True)
if can_run(self):
cmd = os.path.join(self.cpp.build.bindir, "test_package")
self.run(cmd, env="conanrun")

package_folder = load(self, os.path.join(self.build_folder, "package_folder"))
license = load(self, os.path.join(self.build_folder, "license"))
assert os.path.isfile(os.path.join(package_folder, "licenses", "LICENSE.txt"))
assert license == 'BSL-1.0'
2 changes: 1 addition & 1 deletion catch2/.github/workflows/linux-bazel-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
compilation_mode: [fastbuild, dbg, opt]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Mount bazel cache
uses: actions/cache@v3
Expand Down
7 changes: 4 additions & 3 deletions catch2/.github/workflows/linux-meson-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ jobs:
other_pkgs: clang-11

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Prepare environment
run: sudo apt-get install -y meson ninja-build ${{matrix.other_pkgs}}
run: |
sudo apt-get update
sudo apt-get install -y meson ninja-build ${{matrix.other_pkgs}}
- name: Configure build
env:
Expand All @@ -38,6 +40,5 @@ jobs:

- name: Run tests
working-directory: ${{runner.workspace}}/meson-build
# Hardcode 2 cores we know are there
run: |
meson test --verbose
66 changes: 58 additions & 8 deletions catch2/.github/workflows/linux-other-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ jobs:
build_type: Debug
std: 14
other_pkgs: g++-7
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
- cxx: g++-7
build_description: Extras + Examples
build_type: Release
std: 14
other_pkgs: g++-7
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON
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
build_description: Extras + Examples
build_type: Debug
std: 17
other_pkgs: clang-10
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
- cxx: clang++-10
build_description: Extras + Examples
build_type: Release
std: 17
other_pkgs: clang-10
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON
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
Expand All @@ -70,10 +70,12 @@ jobs:


steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Prepare environment
run: sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
- name: Configure build
working-directory: ${{runner.workspace}}
Expand All @@ -100,5 +102,53 @@ jobs:
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
# Hardcode 2 cores we know are there
run: ctest -C ${{matrix.build_type}} -j 2 ${{matrix.other_ctest_args}}
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}}
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}}
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: clang++-${{matrix.version}}
CXXFLAGS: ${{matrix.cxxflags}}
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
clangtidy="clang-tidy-${{matrix.version}};-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 \
-DCMAKE_AR=/usr/bin/true \
-DCMAKE_CXX_COMPILER_AR=/usr/bin/true \
-DCMAKE_RANLIB=/usr/bin/true \
-DCMAKE_CXX_LINK_EXECUTABLE=/usr/bin/true \
${{matrix.cmake_configurations}} \
-G Ninja
- name: Run clang-tidy
working-directory: ${{runner.workspace}}/build
run: ninja
9 changes: 5 additions & 4 deletions catch2/.github/workflows/linux-simple-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
other_pkgs: g++-10

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Add repositories for older GCC
run: |
Expand All @@ -92,7 +92,9 @@ jobs:
if: ${{ matrix.cxx == 'g++-5' || matrix.cxx == 'g++-6' }}

- name: Prepare environment
run: sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
- name: Configure build
working-directory: ${{runner.workspace}}
Expand All @@ -118,5 +120,4 @@ jobs:
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
# Hardcode 2 cores we know are there
run: ctest -C ${{matrix.build_type}} -j 2
run: ctest -C ${{matrix.build_type}} -j `nproc`
44 changes: 44 additions & 0 deletions catch2/.github/workflows/mac-builds-m1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: M1 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`
7 changes: 3 additions & 4 deletions catch2/.github/workflows/mac-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
extra_tests: ON

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure build
working-directory: ${{runner.workspace}}
Expand All @@ -42,11 +42,10 @@ jobs:
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: make -j 2
run: make -j `sysctl -n hw.ncpu`

- name: Run tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
# Hardcode 2 cores we know are there
run: ctest -C ${{matrix.build_type}} -j 2
run: ctest -C ${{matrix.build_type}} -j `sysctl -n hw.ncpu`
Loading

0 comments on commit 91ce271

Please sign in to comment.