Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code coverage #2

Merged
merged 1 commit into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,18 @@ cache:

script:
- mkdir build && cd build
- cmake ..
- |
if [[ "${TRAVIS_OS_NAME}" = "linux" && "${TRAVIS_COMPILER}" = "gcc" ]]; then
cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE
else
cmake .. -DBUILD_TEST=TRUE
fi
- make
- ./tst/webrtc_client_test

after_success:
- |
if [[ "${TRAVIS_OS_NAME}" = "linux" && "${TRAVIS_COMPILER}" = "gcc" ]]; then
for test_file in $(find CMakeFiles/kvsWebrtcClient.dir CMakeFiles/kvsWebrtcSignalingClient.dir -name '*.gcno'); do gcov $test_file; done
bash <(curl -s https://codecov.io/bash)
fi
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
cmake_minimum_required(VERSION 2.8)

set(CMAKE_MACOSX_RPATH TRUE)

project(KinesisVideoWebRTCClient LANGUAGES C)
get_filename_component(ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)

# User Flags
option(ADD_MUCLIBC "Add -muclibc c flag" OFF)
option(BUILD_DEPENDENCIES "Whether or not to build depending libraries from source" ON)
option(BUILD_OPENSSL "If building dependencies, whether or not building openssl from source" OFF)

# Developer Flags
option(CODE_COVERAGE "Enable coverage reporting" OFF)
option(BUILD_TEST "Build the testing tree." OFF)

set(CMAKE_MACOSX_RPATH TRUE)
get_filename_component(ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)

if(NOT KINESIS_VIDEO_PIC_SRC)
if(DEFINED ENV{KINESIS_VIDEO_PIC_SRC})
set(KINESIS_VIDEO_PIC_SRC $ENV{KINESIS_VIDEO_PIC_SRC})
Expand Down Expand Up @@ -263,10 +267,16 @@ endif()

if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU|Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

if(ADD_MUCLIBC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -muclibc")
endif()

if(CODE_COVERAGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fprofile-arcs -ftest-coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif()

find_package(PkgConfig REQUIRED)
set(ENV{PKG_CONFIG_PATH}
"$ENV{PKG_CONFIG_PATH}:${KINESIS_VIDEO_OPEN_SOURCE_SRC}/lib/pkgconfig")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Amazon Kinesis Video Streams C WebRTC SDK
[![Build Status](https://travis-ci.org/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c.svg?branch=master)](https://travis-ci.org/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c)
[![Coverage Status](https://codecov.io/gh/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/branch/master/graph/badge.svg)](https://codecov.io/gh/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c)

## Running
### 1. Download
Expand All @@ -19,8 +21,6 @@ To build the library and the provided samples run make in the build directory yo

`make`



## License

This library is licensed under the Apache 2.0 License.