mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 20:20:30 +00:00
Correctly track coverage for startup.lua too
This commit is contained in:
parent
28a55349a9
commit
02b68b259e
@ -26,6 +26,7 @@ class LuaCoverage {
|
||||
private static final Path ROOT = new File("src/main/resources/data/computercraft/lua").toPath();
|
||||
private static final Path BIOS = ROOT.resolve("bios.lua");
|
||||
private static final Path APIS = ROOT.resolve("rom/apis");
|
||||
private static final Path STARTUP = ROOT.resolve("rom/startup.lua");
|
||||
private static final Path SHELL = ROOT.resolve("rom/programs/shell.lua");
|
||||
private static final Path MULTISHELL = ROOT.resolve("rom/programs/advanced/multishell.lua");
|
||||
private static final Path TREASURE = ROOT.resolve("treasure");
|
||||
@ -56,6 +57,7 @@ class LuaCoverage {
|
||||
var possiblePaths = Stream.of(
|
||||
coverage.remove("/" + full),
|
||||
path.equals(BIOS) ? coverage.remove("bios.lua") : null,
|
||||
path.equals(STARTUP) ? coverage.remove("startup.lua") : null,
|
||||
path.equals(SHELL) ? coverage.remove("shell.lua") : null,
|
||||
path.equals(MULTISHELL) ? coverage.remove("multishell.lua") : null,
|
||||
path.startsWith(APIS) ? coverage.remove(path.getFileName().toString()) : null
|
||||
|
@ -518,7 +518,7 @@ local function before_each(body)
|
||||
before_each_fns[n], before_each_fns.n = body, n
|
||||
end
|
||||
|
||||
local native_co_create, native_loadfile = coroutine.create, loadfile
|
||||
local native_loadfile = loadfile
|
||||
local line_counts = {}
|
||||
if cct_test then
|
||||
local expect = require "cc.expect".expect
|
||||
@ -717,8 +717,6 @@ end
|
||||
term.setTextColour(colours.white) io.write(info .. "\n")
|
||||
|
||||
-- Restore hook stubs
|
||||
debug.sethook(nil, "l")
|
||||
coroutine.create = native_co_create
|
||||
_G.loadfile = native_loadfile
|
||||
|
||||
if cct_test then cct_test.finish(line_counts) end
|
||||
|
Loading…
Reference in New Issue
Block a user