]> granicus.if.org Git - json-c/commitdiff
add coveralls auto tool to json-c
authordota17 <chenguopingdota@163.com>
Mon, 17 Feb 2020 10:15:15 +0000 (18:15 +0800)
committerdota17 <chenguopingdota@163.com>
Tue, 18 Feb 2020 02:39:43 +0000 (10:39 +0800)
.travis.yml
CMakeLists.txt

index 222aa7fa70167bb66b74c81b9ac65a81649e6507..f07c34229d86c3e9c3790276b3da18d9edd2debd 100644 (file)
@@ -78,6 +78,23 @@ matrix:
       osx_image: xcode10.1\r
       env: XCODE="true" CHECK="true"\r
 \r
+#   run coveralls\r
+    - os: linux\r
+      dist: xenial\r
+      compiler: gcc\r
+      env: CHECK="true"\r
+      before_install:\r
+        - sudo pip install cpp-coveralls\r
+      script:\r
+        - mkdir build\r
+        - cd build\r
+        - cmake ..\r
+        - make\r
+        - make test\r
+        - cd -\r
+      after_success:\r
+        - 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\r
+\r
 #  allow_failures:\r
 #    - os: osx\r
 \r
index 0008cbbe9f6ec90bdefcced02d836daca7111af2..296ac137514a83b4badd01dcf786a709d0a38f6d 100644 (file)
@@ -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()