Closed britzl closed 10 years ago
Does your code work simply removing that test? We could make that into a configurable option.
Yes, the current version of LuaCov runs perfectly if I remove the conditional. It collects coverage stats as expected. A configurable option would be great!
I added an entry to the config file format that does what you need!
See luacov/defaults.lua
and README.md
for more info on the config file.
On line 49 of runner.lua (https://github.com/keplerproject/luacov/blob/master/src/luacov/runner.lua#L49) there's a check to make sure that debug.getinfo().source begins with an '@' with the comment saying "ignore Lua code loaded from raw strings". I'm running unit tests/integration tests from within a game engine with Lua scripting and none of the source files begin with '@' in this case. Is there some way this requirement could be turned into an option, or is it needed at all?
I do of course have several workarounds: forking and removing the requirement, modifying a local copy of the code, patching debug.getinfo() to always append an '@' but I'd like to discuss other options as well.