summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-06-17 23:47:19 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-06-17 23:47:19 +0300
commit2e09976f66431277202970df70a51af2f9423f34 (patch)
tree9124a6ffd1fed135c54aa93f5668157e8a604108
parent20146ee107e64b3133bdbc8c0b2d1c8f4f1f679c (diff)
downloadluacov-2e09976f66431277202970df70a51af2f9423f34.tar.gz
Add cluacov support for debug hook
-rw-r--r--src/luacov/runner.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/luacov/runner.lua b/src/luacov/runner.lua
index 6b53184..383f9cc 100644
--- a/src/luacov/runner.lua
+++ b/src/luacov/runner.lua
@@ -95,6 +95,8 @@ function runner.save_stats()
runner.data = {}
end
+local cluacov_ok = pcall(require, "cluacov.version")
+
--------------------------------------------------
-- Debug hook set by LuaCov.
-- Acknowledges that a line is executed, but does nothing
@@ -110,7 +112,7 @@ end
-- extra_processing(line)
-- end
-- @function debug_hook
-runner.debug_hook = require("luacov.hook").new(runner)
+runner.debug_hook = require(cluacov_ok and "cluacov.hook" or "luacov.hook").new(runner)
------------------------------------------------------
-- Runs the reporter specified in configuration.