summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.