diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-06-17 23:47:19 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-06-17 23:47:19 +0300 |
commit | 2e09976f66431277202970df70a51af2f9423f34 (patch) | |
tree | 9124a6ffd1fed135c54aa93f5668157e8a604108 | |
parent | 20146ee107e64b3133bdbc8c0b2d1c8f4f1f679c (diff) | |
download | luacov-2e09976f66431277202970df70a51af2f9423f34.tar.gz |
Add cluacov support for debug hook
-rw-r--r-- | src/luacov/runner.lua | 4 |
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. |