build: make DO_COVERAGE a CMake variable
Travis: remove CXXFLAGS (not used), LDFLAGS (typo, not used) Closes https://github.com/awesomeWM/awesome/pull/2001.
This commit is contained in:
parent
69d06f7e3a
commit
8923df4a5f
15
.travis.yml
15
.travis.yml
|
@ -105,8 +105,7 @@ install:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install dependencies for code coverage testing.
|
# Install dependencies for code coverage testing.
|
||||||
- if [ "$DO_COVERAGE" = "" ]; then export DO_COVERAGE=0; fi
|
- if [ -n "$DO_COVERAGE" ]; then sudo luarocks install cluacov; fi
|
||||||
- if [ "$DO_COVERAGE" != "0" ]; then sudo luarocks install cluacov; fi
|
|
||||||
- if [ "$DO_COVERAGE" = "coveralls" ]; then sudo luarocks install luacov-coveralls; fi
|
- if [ "$DO_COVERAGE" = "coveralls" ]; then sudo luarocks install luacov-coveralls; fi
|
||||||
|
|
||||||
# Determine custom version.
|
# Determine custom version.
|
||||||
|
@ -156,13 +155,7 @@ install:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
script:
|
script:
|
||||||
- export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -DLUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION -DSTRICT_TESTS=true"
|
- export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -DLUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION -DSTRICT_TESTS=true -D DO_COVERAGE=$DO_COVERAGE"
|
||||||
- |
|
|
||||||
if [ "$DO_COVERAGE" = "codecov" ]; then
|
|
||||||
export CXXFLAGS="-fprofile-arcs -ftest-coverage"
|
|
||||||
export CFLAGS="-fprofile-arcs -ftest-coverage"
|
|
||||||
export LDFLAFS="-fprofile-arcs -ftest-coverage"
|
|
||||||
fi
|
|
||||||
- |
|
- |
|
||||||
if [ "$EMPTY_THEME_WHILE_LOADING" = 1 ]; then
|
if [ "$EMPTY_THEME_WHILE_LOADING" = 1 ]; then
|
||||||
# Break beautiful so that trying to access the theme before beautiful.init() causes an error
|
# Break beautiful so that trying to access the theme before beautiful.init() causes an error
|
||||||
|
@ -189,7 +182,7 @@ script:
|
||||||
- |
|
- |
|
||||||
set -ex
|
set -ex
|
||||||
if [ "$TRAVIS_TEST_RESULT" = 0 ]; then
|
if [ "$TRAVIS_TEST_RESULT" = 0 ]; then
|
||||||
if [ "$DO_COVERAGE" != "0" ]; then
|
if [ -n "$DO_COVERAGE" ]; then
|
||||||
travis_fold_start "DO_COVERAGE"
|
travis_fold_start "DO_COVERAGE"
|
||||||
|
|
||||||
# Run tests/examples explicitly.
|
# Run tests/examples explicitly.
|
||||||
|
@ -237,7 +230,7 @@ script:
|
||||||
echo "Testing commit $commit"
|
echo "Testing commit $commit"
|
||||||
git checkout "$commit"
|
git checkout "$commit"
|
||||||
git --no-pager show --stat
|
git --no-pager show --stat
|
||||||
if ! DO_COVERAGE=0 make all check; then
|
if ! make all check CMAKE_ARGS+="-D DO_COVERAGE=0"; then
|
||||||
failed="$failed $commit"
|
failed="$failed $commit"
|
||||||
fi
|
fi
|
||||||
travis_fold_end
|
travis_fold_end
|
||||||
|
|
|
@ -10,8 +10,10 @@ option(WITH_DBUS "build with D-BUS" ON)
|
||||||
option(GENERATE_MANPAGES "generate manpages" ON)
|
option(GENERATE_MANPAGES "generate manpages" ON)
|
||||||
option(COMPRESS_MANPAGES "compress manpages" ON)
|
option(COMPRESS_MANPAGES "compress manpages" ON)
|
||||||
option(GENERATE_DOC "generate API documentation" ON)
|
option(GENERATE_DOC "generate API documentation" ON)
|
||||||
if (GENERATE_DOC AND ENV{DO_COVERAGE})
|
option(DO_COVERAGE "build with coverage" OFF)
|
||||||
|
if (GENERATE_DOC AND DO_COVERAGE)
|
||||||
message(STATUS "Not generating API documentation with DO_COVERAGE")
|
message(STATUS "Not generating API documentation with DO_COVERAGE")
|
||||||
|
set(GENERATE_DOC OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# {{{ Endianness
|
# {{{ Endianness
|
||||||
|
@ -332,6 +334,7 @@ if(DO_COVERAGE)
|
||||||
${BUILD_DIR}/${file}
|
${BUILD_DIR}/${file}
|
||||||
COPYONLY)
|
COPYONLY)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
|
||||||
else()
|
else()
|
||||||
foreach(file ${AWESOME_CONFIGURE_COPYONLY_WITHCOV_FILES})
|
foreach(file ${AWESOME_CONFIGURE_COPYONLY_WITHCOV_FILES})
|
||||||
configure_file(${SOURCE_DIR}/${file}
|
configure_file(${SOURCE_DIR}/${file}
|
||||||
|
|
|
@ -29,7 +29,7 @@ else()
|
||||||
set(TOP_SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
set(TOP_SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DEFINED ENV{DO_COVERAGE} AND NOT $ENV{DO_COVERAGE} STREQUAL "0")
|
if (DO_COVERAGE)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND lua -e "require('luacov.runner')('${TOP_SOURCE_DIR}/.luacov')"
|
COMMAND lua -e "require('luacov.runner')('${TOP_SOURCE_DIR}/.luacov')"
|
||||||
RESULT_VARIABLE TEST_RESULT
|
RESULT_VARIABLE TEST_RESULT
|
||||||
|
|
Loading…
Reference in New Issue