Skip to content

Commit cb39d8a

Browse files
committed
Merge branch 'dev'
2 parents 5b131db + 6226383 commit cb39d8a

39 files changed

+2998
-1032
lines changed

.github/workflows/ci_linux_clang.yml

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,84 @@ defaults:
99
shell: bash
1010

1111
jobs:
12-
clang-ubuntu-20-04:
13-
runs-on: ubuntu-20.04
12+
build:
13+
name: ${{ matrix.config.name }}
14+
runs-on: ${{ matrix.config.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
config:
19+
- {
20+
name: "Ubuntu 20.04 Clang 10",
21+
os: ubuntu-20.04,
22+
build_type: Debug,
23+
cc: "clang-10", cxx: "clang++-10"
24+
}
25+
- {
26+
name: "Ubuntu 20.04 Clang 11",
27+
os: ubuntu-20.04,
28+
build_type: Debug,
29+
cc: "clang-11", cxx: "clang++-11"
30+
}
31+
- {
32+
name: "Ubuntu 20.04 Clang 12",
33+
os: ubuntu-20.04,
34+
build_type: Debug,
35+
cc: "clang-12", cxx: "clang++-12"
36+
}
37+
- {
38+
name: "Ubuntu 22.04 Clang 13",
39+
os: ubuntu-22.04,
40+
build_type: Debug,
41+
cc: "clang-13", cxx: "clang++-13"
42+
}
43+
- {
44+
name: "Ubuntu 22.04 Clang 14 C++11",
45+
os: ubuntu-22.04,
46+
build_type: Debug,
47+
cc: "clang-14", cxx: "clang++-14",
48+
cxx_standard: 11
49+
}
50+
- {
51+
name: "Ubuntu 22.04 Clang 14 C++14",
52+
os: ubuntu-22.04,
53+
build_type: Debug,
54+
cc: "clang-14", cxx: "clang++-14",
55+
cxx_standard: 14
56+
}
57+
- {
58+
name: "Ubuntu 22.04 Clang 14 C++17",
59+
os: ubuntu-22.04,
60+
build_type: Debug,
61+
cc: "clang-14", cxx: "clang++-14",
62+
cxx_standard: 17
63+
}
64+
- {
65+
name: "Ubuntu 22.04 Clang 14 C++20",
66+
os: ubuntu-22.04,
67+
build_type: Debug,
68+
cc: "clang-14", cxx: "clang++-14",
69+
cxx_standard: 20
70+
}
71+
- {
72+
name: "Ubuntu 22.04 Clang with sanitizers",
73+
os: ubuntu-22.04,
74+
build_type: Debug,
75+
cc: "clang", cxx: "clang++",
76+
enable_sanitizers_in_tests: ON
77+
}
1478
steps:
15-
- uses: actions/checkout@v2
79+
- uses: actions/checkout@v3
1680
- name: Build project
81+
env:
82+
CC: ${{ matrix.config.cc }}
83+
CXX: ${{ matrix.config.cxx }}
1784
run: |
18-
CC=clang CXX=clang++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
19-
cmake --build build -j
20-
- name: Run tests
21-
run: |
22-
build/tests/FakeIt_tests
23-
clang-ubuntu-18-04:
24-
runs-on: ubuntu-18.04
25-
steps:
26-
- uses: actions/checkout@v2
27-
- name: Build project
28-
run: |
29-
CC=clang CXX=clang++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
85+
cmake -S . -B build \
86+
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
87+
-DENABLE_TESTING=ON \
88+
-DOVERRIDE_CXX_STANDARD_FOR_TESTS=${{ matrix.config.cxx_standard }} \
89+
-DENABLE_SANITIZERS_IN_TESTS=${{ matrix.config.enable_sanitizers_in_tests }}
3090
cmake --build build -j
3191
- name: Run tests
3292
run: |

.github/workflows/ci_linux_gcc.yml

Lines changed: 69 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,78 @@ defaults:
99
shell: bash
1010

1111
jobs:
12-
coverage:
13-
runs-on: ubuntu-20.04
12+
build:
13+
name: ${{ matrix.config.name }}
14+
runs-on: ${{ matrix.config.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
config:
19+
- {
20+
name: "Ubuntu 20.04 GCC 9",
21+
os: ubuntu-20.04,
22+
build_type: Debug,
23+
cc: "gcc-9", cxx: "g++-9"
24+
}
25+
- {
26+
name: "Ubuntu 20.04 GCC 10",
27+
os: ubuntu-20.04,
28+
build_type: Debug,
29+
cc: "gcc-10", cxx: "g++-10"
30+
}
31+
- {
32+
name: "Ubuntu 22.04 GCC 11",
33+
os: ubuntu-22.04,
34+
build_type: Debug,
35+
cc: "gcc-11", cxx: "g++-11"
36+
}
37+
- {
38+
name: "Ubuntu 22.04 GCC 12 C++11",
39+
os: ubuntu-22.04,
40+
build_type: Debug,
41+
cc: "gcc-12", cxx: "g++-12",
42+
cxx_standard: 11
43+
}
44+
- {
45+
name: "Ubuntu 22.04 GCC 12 C++14",
46+
os: ubuntu-22.04,
47+
build_type: Debug,
48+
cc: "gcc-12", cxx: "g++-12",
49+
cxx_standard: 14
50+
}
51+
- {
52+
name: "Ubuntu 22.04 GCC 12 C++17",
53+
os: ubuntu-22.04,
54+
build_type: Debug,
55+
cc: "gcc-12", cxx: "g++-12",
56+
cxx_standard: 17
57+
}
58+
- {
59+
name: "Ubuntu 22.04 GCC 12 C++20",
60+
os: ubuntu-22.04,
61+
build_type: Debug,
62+
cc: "gcc-12", cxx: "g++-12",
63+
cxx_standard: 20
64+
}
65+
- {
66+
name: "Ubuntu 22.04 GCC with sanitizers",
67+
os: ubuntu-22.04,
68+
build_type: Debug,
69+
cc: "gcc", cxx: "g++",
70+
enable_sanitizers_in_tests: ON
71+
}
1472
steps:
15-
- name: Install LCOV
16-
run: sudo apt install -y lcov
17-
- uses: actions/checkout@v2
73+
- uses: actions/checkout@v3
1874
- name: Build project
75+
env:
76+
CC: ${{ matrix.config.cc }}
77+
CXX: ${{ matrix.config.cxx }}
1978
run: |
20-
CC=gcc CXX=g++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
21-
cmake --build build -j
22-
- name: Run tests
23-
run: |
24-
build/tests/FakeIt_tests
25-
- name: Generate report
26-
run: |
27-
cd build/tests/CMakeFiles/FakeIt_tests.dir
28-
gcov *.o
29-
lcov --directory . -c -o report.info
30-
lcov --remove report.info '/usr/*' '*/tests/*' -o report_filtered.info
31-
- name: Upload report
32-
uses: coverallsapp/github-action@master
33-
with:
34-
github-token: ${{ secrets.GITHUB_TOKEN }}
35-
path-to-lcov: ./build/tests/CMakeFiles/FakeIt_tests.dir/report_filtered.info
36-
gcc-ubuntu-20-04:
37-
runs-on: ubuntu-20.04
38-
steps:
39-
- uses: actions/checkout@v2
40-
- name: Build project
41-
run: |
42-
CC=gcc CXX=g++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
43-
cmake --build build -j
44-
- name: Run tests
45-
run: |
46-
build/tests/FakeIt_tests
47-
gcc-ubuntu-18-04:
48-
runs-on: ubuntu-18.04
49-
steps:
50-
- uses: actions/checkout@v2
51-
- name: Build project
52-
run: |
53-
CC=gcc CXX=g++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
79+
cmake -S . -B build \
80+
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
81+
-DENABLE_TESTING=ON \
82+
-DOVERRIDE_CXX_STANDARD_FOR_TESTS=${{ matrix.config.cxx_standard }} \
83+
-DENABLE_SANITIZERS_IN_TESTS=${{ matrix.config.enable_sanitizers_in_tests }}
5484
cmake --build build -j
5585
- name: Run tests
5686
run: |

.github/workflows/ci_windows_msvc.yml

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,62 @@ defaults:
99
shell: bash
1010

1111
jobs:
12-
msvc-windows-2022:
13-
runs-on: windows-2022
12+
build:
13+
name: ${{ matrix.config.name }}
14+
runs-on: ${{ matrix.config.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
config:
19+
- {
20+
name: "Windows 2019 MSVC 2019 Win32",
21+
os: windows-2019,
22+
build_type: Debug,
23+
generator: "Visual Studio 16 2019",
24+
architecture: "Win32"
25+
}
26+
- {
27+
name: "Windows 2022 MSVC 2022 Win32 C++11",
28+
os: windows-2022,
29+
build_type: Debug,
30+
generator: "Visual Studio 17 2022",
31+
architecture: "Win32",
32+
cxx_standard: 11
33+
}
34+
- {
35+
name: "Windows 2022 MSVC 2022 Win32 C++14",
36+
os: windows-2022,
37+
build_type: Debug,
38+
generator: "Visual Studio 17 2022",
39+
architecture: "Win32",
40+
cxx_standard: 14
41+
}
42+
- {
43+
name: "Windows 2022 MSVC 2022 Win32 C++17",
44+
os: windows-2022,
45+
build_type: Debug,
46+
generator: "Visual Studio 17 2022",
47+
architecture: "Win32",
48+
cxx_standard: 17
49+
}
50+
- {
51+
name: "Windows 2022 MSVC 2022 Win32 C++20",
52+
os: windows-2022,
53+
build_type: Debug,
54+
generator: "Visual Studio 17 2022",
55+
architecture: "Win32",
56+
cxx_standard: 20
57+
}
1458
steps:
15-
- uses: actions/checkout@v2
59+
- uses: actions/checkout@v3
1660
- name: Build project
1761
run: |
18-
cmake -S . -B build -G "Visual Studio 17 2022"
19-
cmake --build build --config Debug -j
62+
cmake -S . -B build \
63+
-G "${{ matrix.config.generator }}" \
64+
-A ${{ matrix.config.architecture }} \
65+
-DENABLE_TESTING=ON \
66+
-DOVERRIDE_CXX_STANDARD_FOR_TESTS=${{ matrix.config.cxx_standard }}
67+
cmake --build build --config ${{ matrix.config.build_type }} -j
2068
- name: Run tests
2169
run: |
22-
echo "Not yet because bugged but it needs to be fixed."
23-
msvc-windows-2019:
24-
runs-on: windows-2019
25-
steps:
26-
- uses: actions/checkout@v2
27-
- name: Build project
28-
run: |
29-
cmake -S . -B build -G "Visual Studio 16 2019"
30-
cmake --build build --config Debug -j
31-
- name: Run tests
32-
run: |
33-
echo "Not yet because bugged but it needs to be fixed."
70+
build/tests/Debug/FakeIt_tests.exe

.github/workflows/coverage.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
coverage:
13+
runs-on: ubuntu-20.04
14+
steps:
15+
- name: Install LCOV
16+
run: sudo apt install -y lcov
17+
- uses: actions/checkout@v3
18+
- name: Build project
19+
env:
20+
CC: gcc-9
21+
CXX: g++-9
22+
run: |
23+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=ON -DENABLE_COVERAGE=ON
24+
cmake --build build -j
25+
- name: Run tests
26+
run: |
27+
build/tests/FakeIt_tests
28+
- name: Generate report
29+
run: |
30+
cd build/tests/CMakeFiles/FakeIt_tests.dir
31+
gcov-9 *.o
32+
lcov --gcov-tool gcov-9 --directory . -c -o report.info
33+
lcov --gcov-tool gcov-9 --remove report.info '/usr/*' '*/tests/*' -o report_filtered.info
34+
- name: Upload report
35+
uses: coverallsapp/github-action@master
36+
with:
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
path-to-lcov: ./build/tests/CMakeFiles/FakeIt_tests.dir/report_filtered.info

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# ARCH_INDEPENDENT option at write_basic_package_version_file requires 3.14 version of CMake.
22
cmake_minimum_required(VERSION 3.14)
33

4-
project(FakeIt VERSION 2.3.2 LANGUAGES CXX)
4+
project(FakeIt VERSION 2.4.0 LANGUAGES CXX)
55

6+
option(ENABLE_TESTING "Enable build of tests." OFF)
7+
option(OVERRIDE_CXX_STANDARD_FOR_TESTS "Override the C++ standard used for building tests." "")
8+
option(ENABLE_SANITIZERS_IN_TESTS "Enable address / undefined sanitizers in tests." OFF)
69
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang." OFF)
710

811
# Directory containing main targets of FakeIt.
@@ -11,8 +14,10 @@ add_subdirectory(include)
1114
# Directory containing config targets of FakeIt.
1215
add_subdirectory(config)
1316

14-
# Directory containing test targets of FakeIt.
15-
add_subdirectory(tests)
17+
if(ENABLE_TESTING)
18+
# Directory containing test targets of FakeIt.
19+
add_subdirectory(tests)
20+
endif()
1621

1722
# Directory containing single header targets of FakeIt.
1823
add_subdirectory(single_header)

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
Don't generate single header files in your pull request, only modify the original files (the ones inside the `include` folder).
2-
3-
Add unit tests for your development or at least provide examples on how to test your changes in your pull request.
1+
When submitting a pull request, you should follow these rules:
2+
* Base your developments on the `dev` branch.
3+
* Don't generate single header files in your pull request, only modify the original files (the ones inside the `include` folder).
4+
* Add unit tests for your development or at least provide examples on how to test your changes in your pull request.

0 commit comments

Comments
 (0)