fix code coverage
This commit is contained in:
15
.github/workflows/busted.yml
vendored
15
.github/workflows/busted.yml
vendored
@@ -1,3 +1,4 @@
|
||||
---
|
||||
name: Busted
|
||||
|
||||
on: [push, pull_request]
|
||||
@@ -50,19 +51,27 @@ jobs:
|
||||
run: |
|
||||
busted -c -v
|
||||
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
|
||||
if: success() && startsWith(matrix.os, 'ubuntu-')
|
||||
run: |
|
||||
gcov -p -b -s"$(pwd)" -r *.gcda
|
||||
rm -f "kiwi#*.gcov"
|
||||
|
||||
- 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
|
||||
|
||||
- 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
|
||||
uses: coverallsapp/github-action@v2
|
||||
with:
|
||||
|
||||
8
Makefile
8
Makefile
@@ -5,7 +5,7 @@ LIBFLAG := -shared
|
||||
LIB_EXT := $(if $(filter Windows_NT,$(OS)),dll,so)
|
||||
LUA_INCDIR := /usr/include
|
||||
|
||||
SRCDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
SRCDIR := .
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
is_clang = $(filter %clang++,$(CXX))
|
||||
@@ -29,13 +29,17 @@ SANITIZE_FLAGS := -fsanitize=undefined -fsanitize=address -fsanitize=alignment -
|
||||
-fsanitize=shift -fsanitize=unreachable -fsanitize=bool \
|
||||
-fsanitize=enum
|
||||
|
||||
COVERAGE_FLAGS := -fprofile-arcs -ftest-coverage
|
||||
COVERAGE_FLAGS := --coverage
|
||||
LTO_FLAGS := -flto=auto
|
||||
|
||||
-include config.mk
|
||||
|
||||
ifeq ($(origin LUAROCKS), command line)
|
||||
ifdef FCOV
|
||||
CCFLAGS := $(patsubst -O%,,$(CFLAGS))
|
||||
else
|
||||
CCFLAGS := $(CFLAGS)
|
||||
endif
|
||||
override CFLAGS := -std=c99 $(CCFLAGS)
|
||||
|
||||
ifneq ($(filter %gcc,$(CC)),)
|
||||
|
||||
Reference in New Issue
Block a user