Moved stuff to builder. Added code coverage.
This commit is contained in:
parent
f26071fb8a
commit
34b1b11ad0
30
.travis.yml
30
.travis.yml
|
|
@ -1,4 +1,6 @@
|
||||||
|
# Kudos to these guys:
|
||||||
# http://genbattle.bitbucket.org/blog/2016/01/17/c++-travis-ci/
|
# http://genbattle.bitbucket.org/blog/2016/01/17/c++-travis-ci/
|
||||||
|
# https://github.com/ticapix/arduino-toolbox/blob/master/.travis.yml
|
||||||
|
|
||||||
# Ubuntu 14.04 Trusty support
|
# Ubuntu 14.04 Trusty support
|
||||||
sudo: required
|
sudo: required
|
||||||
|
|
@ -45,14 +47,38 @@ matrix:
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
|
- sudo apt-get install lcov
|
||||||
- source <(curl -SLs https://raw.githubusercontent.com/fortyseveneffects/travis-ci-arduino/master/install.sh)
|
- source <(curl -SLs https://raw.githubusercontent.com/fortyseveneffects/travis-ci-arduino/master/install.sh)
|
||||||
|
|
||||||
|
install:
|
||||||
|
# Install lcov from source
|
||||||
|
- wget http://ftp.fr.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
|
||||||
|
- tar xf lcov_1.11.orig.tar.gz
|
||||||
|
- sudo make -C lcov-1.11/ install
|
||||||
|
- gem install coveralls-lcov
|
||||||
|
- lcov --version
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
# init coverage to 0 (optional)
|
||||||
|
- lcov --directory . --zerocounters
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
# Build examples with Arduino IDE on each available platform / board
|
||||||
- build_main_platforms
|
- build_main_platforms
|
||||||
|
|
||||||
|
# Build and run unit tests with regular C++ compiler
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug ..
|
- cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
- make
|
- make all
|
||||||
- ctest -V
|
- ctest --verbose
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
# Generate code coverage information & send to Coveralls
|
||||||
|
- cd build
|
||||||
|
- lcov --directory . --capture --output-file coverage.info
|
||||||
|
- lcov --remove coverage.info 'test/*' '/usr/*' 'external/*' --output-file coverage.info
|
||||||
|
- lcov --list coverage.info
|
||||||
|
- coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 2.8.7)
|
cmake_minimum_required(VERSION 2.8.7)
|
||||||
project(arduino_midi_library)
|
project(arduino_midi_library CXX)
|
||||||
|
|
||||||
set(ROOT_SOURCE_DIR ${PROJECT_SOURCE_DIR})
|
add_subdirectory(builder)
|
||||||
include_directories(${ROOT_SOURCE_DIR})
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
setup_builder()
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
|
|
||||||
add_subdirectory(external)
|
add_subdirectory(external)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
macro(setup_builder)
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
|
set(ROOT_SOURCE_DIR ${PROJECT_SOURCE_DIR} CACHE INTERNAL "Repository root directory")
|
||||||
|
set(ROOT_BINARY_DIR "${ROOT_SOURCE_DIR}/build")
|
||||||
|
|
||||||
|
include_directories(${ROOT_SOURCE_DIR})
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
|
||||||
|
endmacro()
|
||||||
Loading…
Reference in New Issue