Skip to content

Commit 5fdc34a

Browse files
committed
Add. Use LuaCov
1 parent 9ffd3f0 commit 5fdc34a

3 files changed

Lines changed: 43 additions & 1 deletion

File tree

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ before_install:
2020
- sudo luarocks install dkjson
2121
- sudo luarocks install luafilesystem
2222
- sudo luarocks install lua-path
23+
- sudo luarocks install luacov-coveralls
2324

2425
install:
2526
- sudo luarocks make rockspecs/lua-curl-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
@@ -34,7 +35,8 @@ script:
3435
- lunit.sh test_curl.lua
3536

3637
after_success:
37-
- coveralls -b .. -r ..
38+
- coveralls -b .. -r .. --dump c.report.json
39+
- luacov-coveralls -j c.report.json
3840

3941
notifications:
4042
email:

test/.luacov

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
return {
2+
configfile = ".luacov",
3+
4+
-- filename to store stats collected
5+
statsfile = "luacov.stats.out",
6+
7+
-- filename to store report
8+
reportfile = "luacov.report.json",
9+
10+
-- Run reporter on completion? (won't work for ticks)
11+
runreport = false,
12+
13+
-- Delete stats file after reporting?
14+
deletestats = false,
15+
16+
-- Patterns for files to include when reporting
17+
-- all will be included if nothing is listed
18+
-- (exclude overrules include, do not include
19+
-- the .lua extension)
20+
include = {
21+
"/cURL$",
22+
"/cURL/.+$",
23+
},
24+
25+
-- Patterns for files to exclude when reporting
26+
-- all will be included if nothing is listed
27+
-- (exclude overrules include, do not include
28+
-- the .lua extension)
29+
exclude = {
30+
},
31+
32+
-- configuration for luacov-coveralls reporter
33+
coveralls = {
34+
pathcorrect = {
35+
{"/usr/local/share/lua/5.[123]", "src/lua"};
36+
},
37+
},
38+
}

test/test_curl.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local _,luacov = pcall(require, "luacov")
2+
13
local HAS_RUNNER = not not lunit
24
local lunit = require "lunit"
35
local TEST_CASE = assert(lunit.TEST_CASE)

0 commit comments

Comments
 (0)