From c684b1d40bb22cf214e03d83e63e149a2499653f Mon Sep 17 00:00:00 2001 From: dota17 Date: Mon, 17 Feb 2020 18:15:15 +0800 Subject: [PATCH] add coveralls auto tool to json-c --- .travis.yml | 17 +++++++++++++++++ CMakeLists.txt | 1 + 2 files changed, 18 insertions(+) diff --git a/.travis.yml b/.travis.yml index 222aa7f..f07c342 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,6 +78,23 @@ matrix: osx_image: xcode10.1 env: XCODE="true" CHECK="true" +# run coveralls + - os: linux + dist: xenial + compiler: gcc + env: CHECK="true" + before_install: + - sudo pip install cpp-coveralls + script: + - mkdir build + - cd build + - cmake .. + - make + - make test + - cd - + after_success: + - coveralls --include arraylist.c --include arraylist.h --include json_object.c --include json_object.h --include json_object_iterator.c --include json_object_iterator.h --include json_object_private.h --include json_pointer.c --include json_pointer.h --include json_tokener.c --include json_tokener.h --include json_util.c --include json_util.h --include json_visit.c --include json_visit.h --include linkhash.c --include linkhash.h --include printbuf.c --include printbuf.h --include random_seed.c --include strerror_override.c + # allow_failures: # - os: osx diff --git a/CMakeLists.txt b/CMakeLists.txt index 0008cbb..296ac13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,7 @@ message(STATUS "Written ${PROJECT_BINARY_DIR}/json_config.h") if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") if ("${DISABLE_WERROR}" STREQUAL "OFF") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") endif() -- 2.49.0