on test failure, switch to a third event loop
Dependencies
- [2]
ZKH2N6MNMerge text0 - [3]
HATSIZ4Asimplify - [4]
AVTNUQYRbasic test-enabled framework - [5]
F2P336NOresolve conflicts - [6]
36Z442IVback to commit 8123959e52f without code editing - [7]
JNJ4R56Xsupport running tests multiple times - [8]
TSV3KPBRtweak format of test failures - [9]
2NTKHMLGconfigurable error handler when running tests - [10]
A3Z3S62Kget rid of dubious heuristic helper - [11]
ARYMNK52merge bugfix: show test failures - [12]
POQ23S4Hfix startup test failures from the driver - [13]
ULKNZUZKresolve conflicts - [*]
3QNOKBFMbeginnings of a test harness
Change contents
- replacement in app.lua at line 141
-- example handler-- if we encounter an error, wait for a fix - edit in app.lua at line 143
print('tests failed; mode error')Mode = 'error'Redo_initialization = true - edit in app.lua at line 144
print(Error_message) - edit in app.lua at line 146
local current_time, previous_read = 0, 0while true doif love.event thenlove.event.pump()for name, a,b,c,d,e,f in love.event.poll() doif name == 'quit' thenos.exit(1)endendendlocal dt = love.timer.step()current_time = current_time + dtif current_time - previous_read > 0.1 thenlocal buf = live.receive_from_driver()if buf thenlocal maybe_mutated = live.run(buf)if maybe_mutated thenTest_errors = {}App.run_tests(record_error)if #Test_errors == 0 thenbreakendError_message = 'There were test failures:\n\n'..table.concat(Test_errors, '\n')print(Error_message)live.send_run_time_error_to_driver(Error_message)endendendlove.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