local current_time, previous_read = 0, 0
while true do
if love.event then
love.event.pump()
for name, a,b,c,d,e,f in love.event.poll() do
if name == 'quit' then
os.exit(1)
end
end
end
local dt = love.timer.step()
current_time = current_time + dt
if current_time - previous_read > 0.1 then
local buf = live.receive_from_driver()
if buf then
local maybe_mutated = live.run(buf)
if maybe_mutated then
Test_errors = {}
App.run_tests(record_error)
if #Test_errors == 0 then
break
end
Error_message = 'There were test failures:\n\n'..table.concat(Test_errors, '\n')
print(Error_message)
live.send_run_time_error_to_driver(Error_message)
end
end
end
love.graphics.origin()
love.graphics.clear(0,0,1)
love.graphics.setColor(1,1,1)
love.graphics.printf(Error_message, 40,40, 600)
love.graphics.present()
love.timer.sleep(0.001)
end