trying to get coverage analysis to reasonable time

This commit is contained in:
Michael Freno
2025-11-20 14:27:34 -05:00
parent d0357672db
commit 92068d5315
17 changed files with 3011 additions and 380 deletions

View File

@@ -127,11 +127,29 @@ function profile.draw()
love.graphics.print("Press - to remove 50 elements", 10, love.graphics.getHeight() - 45)
end
function profile.keypressed(key)
function profile.keypressed(key, profiler)
if key == "=" or key == "+" then
-- Create snapshot before changing element count
if profiler then
local label = string.format("%d elements", profile.elementCount)
profiler:createSnapshot(label, {
elementCount = profile.elementCount,
nestingDepth = profile.nestingDepth
})
end
profile.elementCount = math.min(profile.maxElements, profile.elementCount + 50)
profile.buildLayout()
elseif key == "-" or key == "_" then
-- Create snapshot before changing element count
if profiler then
local label = string.format("%d elements", profile.elementCount)
profiler:createSnapshot(label, {
elementCount = profile.elementCount,
nestingDepth = profile.nestingDepth
})
end
profile.elementCount = math.max(10, profile.elementCount - 50)
profile.buildLayout()
end