1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
name: Linux Builds
# The Linux hosts are those of the Visual X# compiler, which is the first
# user of this framework: the current Ubuntu LTS, and Fedora in a container.
# Both build with Clang, the compiler that project uses everywhere.
on:
push:
branches: [devel]
pull_request:
permissions:
contents: read
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
jobs:
ubuntu:
name: Ubuntu 26.04, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: ubuntu-26.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
std: [17, 20]
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Install Clang, LLVM's coverage tools, CMake and Ninja
run: |
sudo apt-get update
sudo apt-get install -y clang llvm cmake ninja-build python3
- name: Configure
run: |
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCATCH3_BUILD_EXAMPLES=ON \
-DCATCH3_BUILD_EXTRA_TESTS=ON
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build -j
env:
CATCH3_COVERAGE_REQUIRE_MAP: 1
- name: Install, and find the installed package
run: |
cmake --install build --prefix "$RUNNER_TEMP/catch3"
mkdir "$RUNNER_TEMP/consumer"
cat > "$RUNNER_TEMP/consumer/CMakeLists.txt" <<'EOF'
cmake_minimum_required(VERSION 3.16)
project(Consumer CXX)
find_package(Catch3 REQUIRED)
EOF
cmake -S "$RUNNER_TEMP/consumer" -B "$RUNNER_TEMP/consumer/build" \
-GNinja -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_PREFIX_PATH="$RUNNER_TEMP/catch3"
thread-sanitizer:
name: Ubuntu 26.04, C++17, ThreadSanitizer and UBSan
runs-on: ubuntu-26.04
timeout-minutes: 45
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Install Clang, LLVM's coverage tools, CMake and Ninja
run: |
sudo apt-get update
sudo apt-get install -y clang llvm cmake ninja-build python3
- name: Configure with the sanitizers
env:
CXXFLAGS: -fsanitize=thread,undefined
LDFLAGS: -fsanitize=thread,undefined
run: |
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_STANDARD=17 \
-DCATCH3_BUILD_EXTRA_TESTS=ON
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build -R ThreadSafetyTests
fedora:
name: Fedora 43, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: ubuntu-26.04
container: fedora:43
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
std: [17, 20]
steps:
# Git comes first: without it the checkout falls back to an archive of
# the repository, which is not a checkout the tests can ask questions of.
- name: Install Git, Clang, LLVM's coverage tools, CMake and Ninja
run: dnf install -y git clang llvm gcc-c++ cmake ninja-build python3
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Configure
run: |
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCATCH3_BUILD_EXAMPLES=ON \
-DCATCH3_BUILD_EXTRA_TESTS=ON
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build -j
env:
CATCH3_COVERAGE_REQUIRE_MAP: 1
# Catch3 is built with Clang everywhere; GCC's stricter warnings are not
# errors here. The job checks per-test coverage in gcov's format, which
# only GCC writes.
gcc-coverage:
name: Ubuntu 26.04, GCC, per-test coverage with gcov
runs-on: ubuntu-26.04
timeout-minutes: 30
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Install GCC, CMake and Ninja
run: |
sudo apt-get update
sudo apt-get install -y g++ cmake ninja-build python3
- name: Configure
run: |
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_STANDARD=17 \
-DCATCH3_ENABLE_WERROR=OFF
- name: Build
run: cmake --build build --target ProgmasoftSelfTest
- name: Test per-test coverage
env:
CATCH3_RUNNER_FIXTURE: build/tests/RunnerFixture
CATCH3_COVERAGE_FIXTURE: build/tests/CoverageFixture
CATCH3_COVERAGE_REQUIRE_MAP: 1
run: build/tests/ProgmasoftSelfTest --no-history "[coverage]"
|