Add CMake files for the unit tests

- Building unit tests is optional, disabled by default to prevent
  the library clients from pulling the dependency on boost
- Add the unit tests to the Github Actions.
- Use boost::filesystem to manipulate paths for better portability
This commit is contained in:
Pierre Dejoue
2020-07-14 18:16:18 +02:00
parent a269fb4743
commit 7125fdb13b
6 changed files with 61 additions and 7 deletions

View File

@@ -13,12 +13,13 @@ jobs:
image: fedora:32
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: dnf install -yq cmake ninja-build gcc-c++ clang-tools-extra python3-PyYAML
run: dnf install -yq cmake ninja-build gcc-c++ clang-tools-extra python3-PyYAML boost-devel
- name: Build with GCC
run: |
cmake -Bbuild -GNinja
cmake -Bbuild -GNinja -DP2T_BUILD_TESTS=ON
cmake --build build
- name: Build with Clang
@@ -28,3 +29,6 @@ jobs:
- name: Lint with clang-tidy
run: python3 /usr/share/clang/run-clang-tidy.py -header-filter=poly2tri -p=build-clang
- name: Unit tests
run: cd build && ctest --output-on-failure