Update coverage ci

This commit is contained in:
ado 2023-08-08 01:06:27 +02:00
parent f232c7d995
commit d4c9227830
3 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,4 @@
name: ubuntu-latest-gcc-ci name: coverage-ci
on: on:
workflow_dispatch: workflow_dispatch:
@ -18,7 +18,7 @@ on:
- bugfix/** - bugfix/**
jobs: jobs:
gcc_tests: test_coverage:
if: >- if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') && ! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]') ! contains(toJSON(github.event.commits.*.message), '[skip github]')
@ -43,6 +43,11 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: script/ci_install_deps.sh run: script/ci_install_deps.sh
- name: Install test coverage tools
run: |
apt update
apt install -y gcovr lcov
- name: Configure - name: Configure
run: cmake -S test -B build -D CMAKE_BUILD_TYPE=Debug run: cmake -S test -B build -D CMAKE_BUILD_TYPE=Debug

View File

@ -41,6 +41,6 @@ foreach(name IN ITEMS test_splitter test_parser test_converter test_extractions
target_link_libraries("${name}" PRIVATE ssp::ssp fast_float target_link_libraries("${name}" PRIVATE ssp::ssp fast_float
doctest::doctest) doctest::doctest)
target_compile_definitions( target_compile_definitions(
"${name}" PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN CMAKE_GITHUB_CI) "${name}" PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN _CMAKE_GITHUB_CI)
add_test(NAME "${name}" COMMAND "${name}") add_test(NAME "${name}" COMMAND "${name}")
endforeach() endforeach()

View File

@ -6,7 +6,7 @@
#include <vector> #include <vector>
#include <filesystem> #include <filesystem>
#ifdef CMAKE_GITHUB_CI #ifdef _CMAKE_GITHUB_CI
#include <doctest/doctest.h> #include <doctest/doctest.h>
#else #else
#include <doctest.h> #include <doctest.h>