fix code coverage

This commit is contained in:
2024-02-26 22:07:13 -06:00
parent f68c24d9ea
commit 3e56c503e4
2 changed files with 19 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
---
name: Busted name: Busted
on: [push, pull_request] on: [push, pull_request]
@@ -50,19 +51,27 @@ jobs:
run: | run: |
busted -c -v busted -c -v
env: env:
LD_PRELOAD: ${{ matrix.os == 'ubuntu-latest' && '/usr/lib/x86_64-linux-gnu/libasan.so.6:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libubsan.so.1' || '' }} LD_PRELOAD: |-
${{ matrix.os == 'ubuntu-latest' &&
'/usr/lib/x86_64-linux-gnu/libasan.so.6:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libubsan.so.1'
|| '' }}
- name: Run gcov - name: Run gcov
if: success() && startsWith(matrix.os, 'ubuntu-') if: success() && startsWith(matrix.os, 'ubuntu-')
run: | run: |
gcov -p -b -s"$(pwd)" -r *.gcda gcov -p -b -s"$(pwd)" -r *.gcda
rm -f "kiwi#*.gcov"
- name: generate Lua lcov test reports - name: generate Lua lcov test reports
if: success() && !startsWith(matrix.os, 'windows-') && startsWith(matrix.lua_version, 'luajit-') if: |-
success() && !startsWith(matrix.os, 'windows-')
&& startsWith(matrix.lua_version, 'luajit-')
run: luacov run: luacov
- name: Report test coverage - name: Report test coverage
if: success() && !startsWith(matrix.os, 'windows-') && (startsWith(matrix.lua_version, 'luajit-') || startsWith(matrix.os, 'ubuntu-')) if: |-
success() && !startsWith(matrix.os, 'windows-')
&& (startsWith(matrix.lua_version, 'luajit-') || startsWith(matrix.os, 'ubuntu-'))
continue-on-error: true continue-on-error: true
uses: coverallsapp/github-action@v2 uses: coverallsapp/github-action@v2
with: with:

View File

@@ -5,7 +5,7 @@ LIBFLAG := -shared
LIB_EXT := $(if $(filter Windows_NT,$(OS)),dll,so) LIB_EXT := $(if $(filter Windows_NT,$(OS)),dll,so)
LUA_INCDIR := /usr/include LUA_INCDIR := /usr/include
SRCDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) SRCDIR := .
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
is_clang = $(filter %clang++,$(CXX)) is_clang = $(filter %clang++,$(CXX))
@@ -29,13 +29,17 @@ SANITIZE_FLAGS := -fsanitize=undefined -fsanitize=address -fsanitize=alignment -
-fsanitize=shift -fsanitize=unreachable -fsanitize=bool \ -fsanitize=shift -fsanitize=unreachable -fsanitize=bool \
-fsanitize=enum -fsanitize=enum
COVERAGE_FLAGS := -fprofile-arcs -ftest-coverage COVERAGE_FLAGS := --coverage
LTO_FLAGS := -flto=auto LTO_FLAGS := -flto=auto
-include config.mk -include config.mk
ifeq ($(origin LUAROCKS), command line) ifeq ($(origin LUAROCKS), command line)
CCFLAGS := $(CFLAGS) ifdef FCOV
CCFLAGS := $(patsubst -O%,,$(CFLAGS))
else
CCFLAGS := $(CFLAGS)
endif
override CFLAGS := -std=c99 $(CCFLAGS) override CFLAGS := -std=c99 $(CCFLAGS)
ifneq ($(filter %gcc,$(CC)),) ifneq ($(filter %gcc,$(CC)),)