fix(testcov): install lcov and include testcov only when it's on

This commit is contained in:
Soonho Kong 2013-09-26 22:24:24 -07:00
parent 6abb7bf2ff
commit a05b6b476e
2 changed files with 9 additions and 6 deletions

View file

@ -116,6 +116,12 @@ install:
sudo apt-get -qq install python python-pip;
sudo pip install dropbox;
fi
- if [[ $TESTCOV == ON ]]; then
wget http://downloads.sourceforge.net/ltp/lcov-1.10.tar.gz;
tar xvfz lcov-1.10.tar.gz;
cp -v lcov-1.10/bin/{lcov,genpng,gendesc,genhtml,geninfo} /usr/bin/;
rm -rf lcov-1.10.tar.gz lcov-1.10;
fi
before_script:
- if [[ $LEANREPO == BLESSED && $TRIGGER_BB == TRUE ]]; then

View file

@ -35,8 +35,10 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
# Test coverage
if("${TESTCOV}" MATCHES "ON")
include(CodeCoverage)
message(STATUS "Enable test-coverage")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -fprofile-arcs -ftest-coverage")
setup_target_for_coverage(cov ${LEAN_SOURCE_DIR}/../script/run_tests.sh coverage)
endif()
# Compiler-specific C++11 activation.
@ -154,9 +156,4 @@ file(GLOB_RECURSE LEAN_SOURCES
${LEAN_SOURCE_DIR}/[A-Za-z]*.cpp
${LEAN_SOURCE_DIR}/[A-Za-z]*.h)
add_style_check_target(style "${LEAN_SOURCES}")
add_test(NAME style_check
COMMAND ${LEAN_SOURCE_DIR}/cmake/Modules/cpplint.py ${LEAN_SOURCES})
# Include Code Coverage
include(CodeCoverage)
setup_target_for_coverage(cov ${LEAN_SOURCE_DIR}/../script/run_tests.sh coverage)
add_test(NAME style_check COMMAND ${LEAN_SOURCE_DIR}/cmake/Modules/cpplint.py ${LEAN_SOURCES})