Travis-CI Sample Project (C + CMake)

#Build Status codecov-badge

  1. Add CodeCoverage.cmake file to scripts/cmake/ project directory

  2. Enable testing and add test coverage config to CMakeLists.txt (after test executable target setup, see full file):

    #
    # Create make test
    #
    enable_testing()
    add_test(unit-tests ${CMAKE_PROJECT_NAME})
    
    ## Coverage
    set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake)
    include(CodeCoverage)
    setup_target_for_coverage(${CMAKE_PROJECT_NAME}_coverage ${CMAKE_PROJECT_NAME} coverage)
    SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
    SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
    
  3. Coverage badge link: https://codecov.io/gh/IlyaShkurenko/nsfilya/branch/master/graph/badge.svg