summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luacov.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/luacov.lua b/src/luacov.lua
index c7ec710..a44333a 100644
--- a/src/luacov.lua
+++ b/src/luacov.lua
@@ -10,6 +10,10 @@ local tick = package.loaded["luacov.tick"]
local ctr = 0
local luacovlock = os.tmpname()
+local booting = true
+local skip = {}
+M.skip = skip
+
local function on_line(_, line_nr)
if tick then
ctr = ctr + 1
@@ -26,6 +30,16 @@ local function on_line(_, line_nr)
end
name = name:sub(2)
+ -- skip 'luacov.lua' in coverage report
+ if booting then
+ skip[name] = true
+ booting = false
+ end
+
+ if skip[name] then
+ return
+ end
+
local file = data[name]
if not file then
file = {max=0}