Skip to content

Commit

Permalink
added 'coverage' target to Makefile using luacov
Browse files Browse the repository at this point in the history
To get more accurate results, we'll likely need to tweak the settings a
bit in .luacov, but at least we now have a basic working setting for
generating coverage reports.

Not yet adding this to `make ci` - we can always do so once we play with
it more , and use a more readable coverage reporter such as
luacov-console, luacov-cobertura, luacov-coveralls, etc.
  • Loading branch information
jaawerth committed Jun 29, 2020
1 parent 5db423d commit add30a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .luacov
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- setting default behaviors for luacov. For documentation on the options,
-- see https://keplerproject.github.io/luacov/doc/modules/luacov.defaults.html

return {
runreport = true,
}

-- vim: ft=lua
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ lua-5.3.5/src/liblua-mingw.a: lua-5.3.5
ci: luacheck testall count

clean:
rm -f fennel fennel-bin *_binary.c fennel-bin.exe
rm -f fennel fennel-bin *_binary.c fennel-bin.exe built-ins luacov.*
make -C lua-5.3.5 clean || true # this dir might not exist

.PHONY: test testall luacheck count ci clean
coverage: fennel
# need a symlink for the fake 'built-ins' module set on macros in fennel.lua
ln -s fennel.lua built-ins && rm -f luacov.*
$(LUA) -lluacov test/init.lua && rm -f built-ins
@echo "generated luacov.report.out"
@echo "Note: 'built-ins' coverage is inaccurate because it isn't a real file."

.PHONY: test testall luacheck count ci clean coverage

0 comments on commit add30a3

Please sign in to comment.