Skip to content

Commit

Permalink
fix code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jkl1337 committed Feb 27, 2024
1 parent f68c24d commit 3e56c50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/busted.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Busted

on: [push, pull_request]
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
CCFLAGS := $(CFLAGS)
ifdef FCOV
CCFLAGS := $(patsubst -O%,,$(CFLAGS))
else
CCFLAGS := $(CFLAGS)
endif
override CFLAGS := -std=c99 $(CCFLAGS)

ifneq ($(filter %gcc,$(CC)),)
Expand Down

0 comments on commit 3e56c50

Please sign in to comment.