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:
workflow_dispatch:
@ -18,7 +18,7 @@ on:
- bugfix/**
jobs:
gcc_tests:
test_coverage:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')
@ -43,6 +43,11 @@ jobs:
- name: Install dependencies
run: script/ci_install_deps.sh
- name: Install test coverage tools
run: |
apt update
apt install -y gcovr lcov
- name: Configure
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
doctest::doctest)
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}")
endforeach()

View File

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