Selaa lähdekoodia

Added code coverage badge

Benoit Blanchon 11 vuotta sitten
vanhempi
sitoutus
160ce092ff
3 muutettua tiedostoa jossa 14 lisäystä ja 3 poistoa
  1. 8 2
      .travis.yml
  2. 5 0
      CMakeLists.txt
  3. 1 1
      README.md

+ 8 - 2
.travis.yml

@@ -2,5 +2,11 @@ language: c++
 compiler:
   - gcc
   - clang
-before_script: cmake .
-script: make && make test
+before_install:
+  - sudo pip install cpp-coveralls
+before_script:
+  - cmake -DCOVERAGE=true .
+script:
+  - make && make test
+after_success:
+  - coveralls --include include --include src --gcov-options '\-lp'

+ 5 - 0
CMakeLists.txt

@@ -11,5 +11,10 @@ if(MSVC)
 	add_definitions(-D_CRT_SECURE_NO_WARNINGS -W4)
 endif()
 
+if(${COVERAGE})
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -coverage")
+	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -coverage")
+endif()
+
 add_subdirectory(src)
 add_subdirectory(test)

+ 1 - 1
README.md

@@ -1,7 +1,7 @@
 Arduino JSON library
 ====================
 
-[![Build Status](https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=master)](https://travis-ci.org/bblanchon/ArduinoJson)
+[![Build Status](https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=master)](https://travis-ci.org/bblanchon/ArduinoJson) [![Coverage Status](https://img.shields.io/coveralls/bblanchon/ArduinoJson.svg)](https://coveralls.io/r/bblanchon/ArduinoJson?branch=master)
 
 *An elegant and efficient JSON library for embedded systems.*