1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00

enables coverage generation again (but uses guard)

This commit is contained in:
Falk Werner 2019-05-25 03:18:25 +02:00
parent 8ede6595d9
commit 9434991184
3 changed files with 27 additions and 23 deletions

View File

@ -16,13 +16,13 @@ env:
- PARALLELMFLAGS="-j4"
- PORTABLE_WORSPACE=1
matrix:
- BUILDTYPE=Debug MARCH=amd64 CHECK_TARGET=memcheck
- BUILDTYPE=Release MARCH=amd64 CHECK_TARGET=memcheck
- BUILDTYPE=Debug MARCH=arm32v7 CHECK_TARGET=check
- BUILDTYPE=MinSizeRel MARCH=arm32v7 CHECK_TARGET=check
- BUILDTYPE=Debug MARCH=amd64 CHECK_TARGET=memcheck COVERAGE=ON
- BUILDTYPE=Release MARCH=amd64 CHECK_TARGET=memcheck COVERAGE=OFF
- BUILDTYPE=Debug MARCH=arm32v7 CHECK_TARGET=check COVERAGE=OFF
- BUILDTYPE=MinSizeRel MARCH=arm32v7 CHECK_TARGET=check COVERAGE=OFF
before_script:
- make BUILDTYPE=$BUILDTYPE MARCH=$MARCH
- make BUILDTYPE=$BUILDTYPE MARCH=$MARCH COVERAGE=$COVERAGE
script:
- make BUILDTYPE=$BUILDTYPE MARCH=$MARCH $CHECK_TARGET
- make BUILDTYPE=$BUILDTYPE MARCH=$MARCH COVERAGE=$COVERAGE $CHECK_TARGET
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@ -3,6 +3,7 @@ project(webfuse VERSION 0.2.0 DESCRIPTION "Websocket filesystem based on libfuse
option(WITHOUT_TESTS "disable unit tests" OFF)
option(WITHOUT_EXAMPLE "disable example" OFF)
option(WITH_COVERAGE "enable code coverage" OFF)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
@ -22,24 +23,24 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(C_WARNINGS -Wall -Wextra)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
#
#add_definitions(
# -pg
# --coverage
# -fprofile-arcs
# -ftest-coverage
#)
if(("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") AND WITHOUT_COVERAGE)
#if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
# link_libraries(gcov)
#else()
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
#endif()
add_definitions(
-pg
--coverage
-fprofile-arcs
-ftest-coverage
)
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg -fprofile-arcs")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
link_libraries(gcov)
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif()
#endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg -fprofile-arcs")
endif()
include_directories(
"include"

View File

@ -23,6 +23,7 @@ SCRIPTDIR ?= $(PROJECTDIR)/build/mkdocker
OUTDIR ?= $(PROJECTDIR)/.build
FETCHDIR ?= $(PROJECTDIR)/.deps
BUILDTYPE ?= Debug
COVERAGE ?= OFF
SKIP_FETCH ?=
@ -115,6 +116,8 @@ OUTDIRS += $(OUTDIR)/src
EXTRACT_TARGETS += $(OUTDIR)/docker/qemu-arm-static-$(QEMU_VERSION)
EXTRACT_TARGETS += $(patsubst $(FETCHDIR)/%.tar.gz,$(OUTDIR)/src/%,$(FETCH_TARGETS))
CMAKEFLAGS += -DWITH_COVERAGE=$(COVERAGE)
#######################################################################################################################
# Makefile dependencies