summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-05-13 15:34:52 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-05-13 15:34:52 +0100
commit883b64e4c546d1ea69075a22b0ff27cd7f11bfaa (patch)
treebb1ac0e9215d323d59c37e84cfd7b22c9006e1bd
parent2660d00dabf410fa1a50ea41bfbb0e9aa5004006 (diff)
downloadlace-883b64e4c546d1ea69075a22b0ff27cd7f11bfaa.tar.gz
LUACOV: Add -X to exclude test stuff
-rwxr-xr-xextras/luacov/src/bin/luacov21
1 files changed, 20 insertions, 1 deletions
diff --git a/extras/luacov/src/bin/luacov b/extras/luacov/src/bin/luacov
index 1a22947..8ef39e1 100755
--- a/extras/luacov/src/bin/luacov
+++ b/extras/luacov/src/bin/luacov
@@ -14,8 +14,19 @@ local report = io.open("luacov.report.out", "w")
-- only report on files specified on the command line
local patterns = {}
+local exclude_patterns = {}
+local exclude_next = false
for i = 1, #arg do
- patterns[i] = arg[i]
+ if arg[i] == "-X" then
+ exclude_next = true
+ else
+ if exclude_next then
+ exclude_patterns[#exclude_patterns+1] = arg[i]
+ exclude_next = false
+ else
+ patterns[#patterns+1] = arg[i]
+ end
+ end
end
local names = {}
@@ -32,6 +43,14 @@ for filename, _ in pairs(data) do
end
end
if include then
+ for _, p in ipairs(exclude_patterns) do
+ if path:match(p) then
+ include = false
+ break
+ end
+ end
+ end
+ if include then
table.insert(names, filename)
end
end