Add. Use LuaCov
parent
9ffd3f01de
commit
5fdc34a47d
|
@ -20,6 +20,7 @@ before_install:
|
|||
- sudo luarocks install dkjson
|
||||
- sudo luarocks install luafilesystem
|
||||
- sudo luarocks install lua-path
|
||||
- sudo luarocks install luacov-coveralls
|
||||
|
||||
install:
|
||||
- sudo luarocks make rockspecs/lua-curl-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
|
||||
|
@ -34,7 +35,8 @@ script:
|
|||
- lunit.sh test_curl.lua
|
||||
|
||||
after_success:
|
||||
- coveralls -b .. -r ..
|
||||
- coveralls -b .. -r .. --dump c.report.json
|
||||
- luacov-coveralls -j c.report.json
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
configfile = ".luacov",
|
||||
|
||||
-- filename to store stats collected
|
||||
statsfile = "luacov.stats.out",
|
||||
|
||||
-- filename to store report
|
||||
reportfile = "luacov.report.json",
|
||||
|
||||
-- Run reporter on completion? (won't work for ticks)
|
||||
runreport = false,
|
||||
|
||||
-- Delete stats file after reporting?
|
||||
deletestats = false,
|
||||
|
||||
-- Patterns for files to include when reporting
|
||||
-- all will be included if nothing is listed
|
||||
-- (exclude overrules include, do not include
|
||||
-- the .lua extension)
|
||||
include = {
|
||||
"/cURL$",
|
||||
"/cURL/.+$",
|
||||
},
|
||||
|
||||
-- Patterns for files to exclude when reporting
|
||||
-- all will be included if nothing is listed
|
||||
-- (exclude overrules include, do not include
|
||||
-- the .lua extension)
|
||||
exclude = {
|
||||
},
|
||||
|
||||
-- configuration for luacov-coveralls reporter
|
||||
coveralls = {
|
||||
pathcorrect = {
|
||||
{"/usr/local/share/lua/5.[123]", "src/lua"};
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
local _,luacov = pcall(require, "luacov")
|
||||
|
||||
local HAS_RUNNER = not not lunit
|
||||
local lunit = require "lunit"
|
||||
local TEST_CASE = assert(lunit.TEST_CASE)
|
||||
|
|
Loading…
Reference in New Issue