awesome/.luacov
Daniel Hahler 6aee6c2053 ci: overhaul coverage processing
- Execute the tests without compiling, and don't mess with the source
   files when coverage is enabled.
   This ensures that the coverage report lines are correct.
   This disables the doc tests, as their results would be unused.
   Hack: it still expands macros on util.lua, because of
   `util.get_themes_dir()` and `util.get_awesome_icon_dir()`, which might
   be moved later.  Ref:
   https://github.com/awesomeWM/awesome/pull/1239#discussion_r93828178.
 - ensure that BUILD_APIDOC and DO_COVERAGE are not used together
 - awesomeConfig.cmake: add DO_COVERAGE as an option
 - Travis: only install codecov with DO_COVERAGE=codecov
 - Travis: do not use set -v; use set -x with DO_COVERAGE
 - do not use trailing slashes with dirs in tests/examples/CMakeLists.txt / .luacov
 - Use latest luacov (0.12.0-1) again
   This reverts parts of 4cc6a815.
   I think it is better to fix any failure that 4cc6a815 tried to work around.
 - Travis: simplify/fix require('luacov') for functionaltests
 - tests/examples/CMakeLists.txt: resolve ../.. in SOURCE_DIR
 - tests/examples/CMakeLists.txt: add DO_COVERAGE to env
 - Cleanup/simplify .luacov: work with SOURCE_DIRECTORY alone
 - tests/run.sh: pass through / set SOURCE_DIRECTORY when running awesome
 - tests/run.sh: resolve source_dir
 - use DO_COVERAGE from env only
2017-01-08 20:34:13 +01:00

31 lines
837 B
Lua

-- Configuration file for LuaCov
-- This variable is set externally
local source = os.getenv("SOURCE_DIRECTORY") or os.getenv('PWD')
local build = os.getenv("BUILD_DIRECTORY") or (source .. "/build")
local lib_dir = os.getenv("AWESOME_LIB_DIR") or (source .. "/lib")
local function escape_pattern(str)
return string.gsub(str, "%W", "%%%1")
end
return {
statsfile = build .. "/luacov.stats.out",
include = {
escape_pattern(lib_dir) .. "/.+",
-- For things already having the correct path
-- (happens with integration tests)
"^lib/",
},
-- configuration for luacov-coveralls reporter
coveralls = {
pathcorrect = {
{ escape_pattern(lib_dir..'/'), "lib/"},
},
},
}
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80