summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Czaplinski <mateusz@czaplinski.pl>2011-05-30 21:25:22 +0200
committerMateusz Czaplinski <mateusz@czaplinski.pl>2011-05-30 21:25:22 +0200
commitbdbd94a266c410a879db6bf2e6cb0a8cc1918760 (patch)
tree070b75311778cc36d8db979080dd3d48dd7b34ee
parentc374d754005e508a1631b32aa5014ab5b9d49b73 (diff)
downloadluacov-bdbd94a266c410a879db6bf2e6cb0a8cc1918760.tar.bz2
Drop 'luacov.lua' from coverage data collection.
-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}