Skip to content

Commit

Permalink
maint: add travis test results and codecov.io coverage reporting.
Browse files Browse the repository at this point in the history
* .luacov: New file.
* .travis.yml (script): Run specl in coverage mode.
(after_success): Upload coverage report.
* .gitignore: Ignore luacov output files.

Signed-off-by: Gary V. Vaughan <[email protected]>
  • Loading branch information
gvvaughan committed Jan 22, 2017
1 parent ba078ae commit 6f344a8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
/ChangeLog
/doc
/build-aux/config.ld
/luacov.*.out
/lyaml-*.tar.gz
/TAGS
47 changes: 47 additions & 0 deletions .luacov
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
return {
-- filename to store stats collected
["statsfile"] = "luacov.stats.out",

-- filename to store report
["reportfile"] = "luacov.report.out",

-- luacov.stats file updating frequency.
-- The lower this value - the more frequenty results will be written out to luacov.stats
-- You may want to reduce this value for short lived scripts (to for example 2) to avoid losing coverage data.
["savestepsize"] = 100,

-- Run reporter on completion? (won't work for ticks)
runreport = true,

-- Delete stats file after reporting?
deletestats = false,

-- Process Lua code loaded from raw strings
-- (that is, when the 'source' field in the debug info
-- does not start with '@')
codefromstrings = 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, path separator is always '/')
["include"] = {
"lib/lyaml/init$",
"lib/lyaml/explicit$",
"lib/lyaml/functional$",
"lib/lyaml/implicit$",
},

-- Patterns for files to exclude when reporting
-- all will be included if nothing is listed
-- (exclude overrules include, do not include
-- the .lua extension, path separator is always '/')
["exclude"] = {
"luacov$",
"luacov/reporter$",
"luacov/defaults$",
"luacov/runner$",
"luacov/stats$",
"luacov/tick$",
},
}
33 changes: 9 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,30 @@ language: python
sudo: false

env:
global:
- _inst=$TRAVIS_BUILD_DIR/_inst
matrix:
- VLUA="lua=5.3"
- VLUA="lua=5.2"
- VLUA="lua=5.1"
- VLUA="luajit=2.1"
- VLUA="luajit=2.0"


before_install:
- pip install hererocks
- hererocks here -r^ --$VLUA
- export PATH=$PWD/here/bin:$PATH


install:
# Use Lua 5.3 compatible rocks, where available.
- 'for rock in ansicolors ldoc specl""; do
if test -z "$rock"; then break; fi;
if luarocks list | grep "^$rock$" >/dev/null; then continue; fi;
luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock;
done'

# Build from rockspec, forcing uninstall of older luarocks installed
# above when testing the git rockspec, both for enforcing backwards
# compatibility by default, and for ease of maintenance.
- if test -f 'lyaml-6.1-1.rockspec'; then
luarocks make 'lyaml-6.1-1.rockspec';
else
luarocks make --force 'lyaml-git-1.rockspec';
fi

- luarocks install ldoc
- luarocks install ansicolors
- luarocks install specl
- luarocks install luacov

script:
- build-aux/luke
LUA=`pwd`/here/bin/lua
LUA_INCDIR=`pwd`/here/include
PREFIX="$_inst" all install
- luarocks make --force lyaml-git-1.rockspec
- specl -vfreport --coverage specs/*_spec.yaml

after_success:
- bash <(curl -s https://codecov.io/bash) -f luacov.report.out

notifications:
slack: aspirinc:JyWeNrIdS0J5nf2Pn2BS1cih

0 comments on commit 6f344a8

Please sign in to comment.