Skip to content

Commit 82e99b7

Browse files
committed
Merge pull request #35 from moteus/master
Add. Use LuaCov
2 parents 961bdad + 5fdc34a commit 82e99b7

7 files changed

Lines changed: 74 additions & 6 deletions

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:

src/lua/cURL.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
--
2+
-- Author: Alexey Melnichuk <mimir@newmail.ru>
3+
--
4+
-- Copyright (C) 2014 Alexey Melnichuk <mimir@newmail.ru>
5+
--
6+
-- Licensed according to the included 'LICENSE' document
7+
--
8+
-- This file is part of Lua-cURL library.
9+
--
10+
111
local curl = require "lcurl"
212
local impl = require "cURL.impl.cURL"
313

src/lua/cURL/impl/cURL.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
--
66
-- Licensed according to the included 'LICENSE' document
77
--
8-
-- This file is part of lua-lcurl library.
9-
--
10-
11-
--
12-
-- Implementation of Lua-cURL http://msva.github.io/lua-curl
8+
-- This file is part of Lua-cURL library.
139
--
1410

1511
local function clone(t, o)

src/lua/cURL/safe.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
--
2+
-- Author: Alexey Melnichuk <mimir@newmail.ru>
3+
--
4+
-- Copyright (C) 2014 Alexey Melnichuk <mimir@newmail.ru>
5+
--
6+
-- Licensed according to the included 'LICENSE' document
7+
--
8+
-- This file is part of Lua-cURL library.
9+
--
10+
111
local curl = require "lcurl.safe"
212
local impl = require "cURL.impl.cURL"
313

src/lua/cURL/utils.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
--
2+
-- Author: Alexey Melnichuk <mimir@newmail.ru>
3+
--
4+
-- Copyright (C) 2014 Alexey Melnichuk <mimir@newmail.ru>
5+
--
6+
-- Licensed according to the included 'LICENSE' document
7+
--
8+
-- This file is part of Lua-cURL library.
9+
--
10+
111
--- Returns path to cURL ca bundle
212
--
313
-- @tparam[opt="curl-ca-bundle.crt"] string name name of bundle

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)