Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckRJ committed Apr 17, 2023
2 parents 5b131db + 6226383 commit cb39d8a
Show file tree
Hide file tree
Showing 39 changed files with 2,998 additions and 1,032 deletions.
90 changes: 75 additions & 15 deletions .github/workflows/ci_linux_clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,84 @@ defaults:
shell: bash

jobs:
clang-ubuntu-20-04:
runs-on: ubuntu-20.04
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu 20.04 Clang 10",
os: ubuntu-20.04,
build_type: Debug,
cc: "clang-10", cxx: "clang++-10"
}
- {
name: "Ubuntu 20.04 Clang 11",
os: ubuntu-20.04,
build_type: Debug,
cc: "clang-11", cxx: "clang++-11"
}
- {
name: "Ubuntu 20.04 Clang 12",
os: ubuntu-20.04,
build_type: Debug,
cc: "clang-12", cxx: "clang++-12"
}
- {
name: "Ubuntu 22.04 Clang 13",
os: ubuntu-22.04,
build_type: Debug,
cc: "clang-13", cxx: "clang++-13"
}
- {
name: "Ubuntu 22.04 Clang 14 C++11",
os: ubuntu-22.04,
build_type: Debug,
cc: "clang-14", cxx: "clang++-14",
cxx_standard: 11
}
- {
name: "Ubuntu 22.04 Clang 14 C++14",
os: ubuntu-22.04,
build_type: Debug,
cc: "clang-14", cxx: "clang++-14",
cxx_standard: 14
}
- {
name: "Ubuntu 22.04 Clang 14 C++17",
os: ubuntu-22.04,
build_type: Debug,
cc: "clang-14", cxx: "clang++-14",
cxx_standard: 17
}
- {
name: "Ubuntu 22.04 Clang 14 C++20",
os: ubuntu-22.04,
build_type: Debug,
cc: "clang-14", cxx: "clang++-14",
cxx_standard: 20
}
- {
name: "Ubuntu 22.04 Clang with sanitizers",
os: ubuntu-22.04,
build_type: Debug,
cc: "clang", cxx: "clang++",
enable_sanitizers_in_tests: ON
}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build project
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: |
CC=clang CXX=clang++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j
- name: Run tests
run: |
build/tests/FakeIt_tests
clang-ubuntu-18-04:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build project
run: |
CC=clang CXX=clang++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DENABLE_TESTING=ON \
-DOVERRIDE_CXX_STANDARD_FOR_TESTS=${{ matrix.config.cxx_standard }} \
-DENABLE_SANITIZERS_IN_TESTS=${{ matrix.config.enable_sanitizers_in_tests }}
cmake --build build -j
- name: Run tests
run: |
Expand Down
108 changes: 69 additions & 39 deletions .github/workflows/ci_linux_gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,78 @@ defaults:
shell: bash

jobs:
coverage:
runs-on: ubuntu-20.04
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu 20.04 GCC 9",
os: ubuntu-20.04,
build_type: Debug,
cc: "gcc-9", cxx: "g++-9"
}
- {
name: "Ubuntu 20.04 GCC 10",
os: ubuntu-20.04,
build_type: Debug,
cc: "gcc-10", cxx: "g++-10"
}
- {
name: "Ubuntu 22.04 GCC 11",
os: ubuntu-22.04,
build_type: Debug,
cc: "gcc-11", cxx: "g++-11"
}
- {
name: "Ubuntu 22.04 GCC 12 C++11",
os: ubuntu-22.04,
build_type: Debug,
cc: "gcc-12", cxx: "g++-12",
cxx_standard: 11
}
- {
name: "Ubuntu 22.04 GCC 12 C++14",
os: ubuntu-22.04,
build_type: Debug,
cc: "gcc-12", cxx: "g++-12",
cxx_standard: 14
}
- {
name: "Ubuntu 22.04 GCC 12 C++17",
os: ubuntu-22.04,
build_type: Debug,
cc: "gcc-12", cxx: "g++-12",
cxx_standard: 17
}
- {
name: "Ubuntu 22.04 GCC 12 C++20",
os: ubuntu-22.04,
build_type: Debug,
cc: "gcc-12", cxx: "g++-12",
cxx_standard: 20
}
- {
name: "Ubuntu 22.04 GCC with sanitizers",
os: ubuntu-22.04,
build_type: Debug,
cc: "gcc", cxx: "g++",
enable_sanitizers_in_tests: ON
}
steps:
- name: Install LCOV
run: sudo apt install -y lcov
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build project
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: |
CC=gcc CXX=g++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
cmake --build build -j
- name: Run tests
run: |
build/tests/FakeIt_tests
- name: Generate report
run: |
cd build/tests/CMakeFiles/FakeIt_tests.dir
gcov *.o
lcov --directory . -c -o report.info
lcov --remove report.info '/usr/*' '*/tests/*' -o report_filtered.info
- name: Upload report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./build/tests/CMakeFiles/FakeIt_tests.dir/report_filtered.info
gcc-ubuntu-20-04:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build project
run: |
CC=gcc CXX=g++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j
- name: Run tests
run: |
build/tests/FakeIt_tests
gcc-ubuntu-18-04:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build project
run: |
CC=gcc CXX=g++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DENABLE_TESTING=ON \
-DOVERRIDE_CXX_STANDARD_FOR_TESTS=${{ matrix.config.cxx_standard }} \
-DENABLE_SANITIZERS_IN_TESTS=${{ matrix.config.enable_sanitizers_in_tests }}
cmake --build build -j
- name: Run tests
run: |
Expand Down
71 changes: 54 additions & 17 deletions .github/workflows/ci_windows_msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,62 @@ defaults:
shell: bash

jobs:
msvc-windows-2022:
runs-on: windows-2022
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows 2019 MSVC 2019 Win32",
os: windows-2019,
build_type: Debug,
generator: "Visual Studio 16 2019",
architecture: "Win32"
}
- {
name: "Windows 2022 MSVC 2022 Win32 C++11",
os: windows-2022,
build_type: Debug,
generator: "Visual Studio 17 2022",
architecture: "Win32",
cxx_standard: 11
}
- {
name: "Windows 2022 MSVC 2022 Win32 C++14",
os: windows-2022,
build_type: Debug,
generator: "Visual Studio 17 2022",
architecture: "Win32",
cxx_standard: 14
}
- {
name: "Windows 2022 MSVC 2022 Win32 C++17",
os: windows-2022,
build_type: Debug,
generator: "Visual Studio 17 2022",
architecture: "Win32",
cxx_standard: 17
}
- {
name: "Windows 2022 MSVC 2022 Win32 C++20",
os: windows-2022,
build_type: Debug,
generator: "Visual Studio 17 2022",
architecture: "Win32",
cxx_standard: 20
}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build project
run: |
cmake -S . -B build -G "Visual Studio 17 2022"
cmake --build build --config Debug -j
cmake -S . -B build \
-G "${{ matrix.config.generator }}" \
-A ${{ matrix.config.architecture }} \
-DENABLE_TESTING=ON \
-DOVERRIDE_CXX_STANDARD_FOR_TESTS=${{ matrix.config.cxx_standard }}
cmake --build build --config ${{ matrix.config.build_type }} -j
- name: Run tests
run: |
echo "Not yet because bugged but it needs to be fixed."
msvc-windows-2019:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Build project
run: |
cmake -S . -B build -G "Visual Studio 16 2019"
cmake --build build --config Debug -j
- name: Run tests
run: |
echo "Not yet because bugged but it needs to be fixed."
build/tests/Debug/FakeIt_tests.exe
38 changes: 38 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Coverage

on:
push:
pull_request:

defaults:
run:
shell: bash

jobs:
coverage:
runs-on: ubuntu-20.04
steps:
- name: Install LCOV
run: sudo apt install -y lcov
- uses: actions/checkout@v3
- name: Build project
env:
CC: gcc-9
CXX: g++-9
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=ON -DENABLE_COVERAGE=ON
cmake --build build -j
- name: Run tests
run: |
build/tests/FakeIt_tests
- name: Generate report
run: |
cd build/tests/CMakeFiles/FakeIt_tests.dir
gcov-9 *.o
lcov --gcov-tool gcov-9 --directory . -c -o report.info
lcov --gcov-tool gcov-9 --remove report.info '/usr/*' '*/tests/*' -o report_filtered.info
- name: Upload report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./build/tests/CMakeFiles/FakeIt_tests.dir/report_filtered.info
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# ARCH_INDEPENDENT option at write_basic_package_version_file requires 3.14 version of CMake.
cmake_minimum_required(VERSION 3.14)

project(FakeIt VERSION 2.3.2 LANGUAGES CXX)
project(FakeIt VERSION 2.4.0 LANGUAGES CXX)

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

# Directory containing main targets of FakeIt.
Expand All @@ -11,8 +14,10 @@ add_subdirectory(include)
# Directory containing config targets of FakeIt.
add_subdirectory(config)

# Directory containing test targets of FakeIt.
add_subdirectory(tests)
if(ENABLE_TESTING)
# Directory containing test targets of FakeIt.
add_subdirectory(tests)
endif()

# Directory containing single header targets of FakeIt.
add_subdirectory(single_header)
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Don't generate single header files in your pull request, only modify the original files (the ones inside the `include` folder).

Add unit tests for your development or at least provide examples on how to test your changes in your pull request.
When submitting a pull request, you should follow these rules:
* Base your developments on the `dev` branch.
* Don't generate single header files in your pull request, only modify the original files (the ones inside the `include` folder).
* Add unit tests for your development or at least provide examples on how to test your changes in your pull request.
Loading

0 comments on commit cb39d8a

Please sign in to comment.