fix initialization errors using driver.love
Dependencies
- [2]
QRUFNFPPMerge text0 - [3]
BQH7ANWMresolve conflicts - [4]
GSIADI3Srun all tests on startup - [5]
YONFBSVBdon't hide errors when driver.love connects - [6]
PJ5PQAQErecord support for multiple versions - [7]
IM6GSGVZfix some arg names - [8]
36Z442IVback to commit 8123959e52f without code editing - [9]
D2TYFYG2Merge text.love - [10]
3QNOKBFMbeginnings of a test harness - [11]
T7QIIGQ6attempt at better error recovery - [12]
JNJ4R56Xsupport running tests multiple times - [13]
XGHCLIKBMerge lines.love - [14]
UZHSWA3DMerge text0 - [15]
IZGDTFAMmake preprocessing more obvious - [16]
YF2ATH2QMerge lines.love - [17]
LRDM35CEapp running again - [*]
OTIBCAUJlove2d scaffold - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [*]
DTBFNHJDmanual tests for the protocol with the driver
Change contents
- replacement in main.lua at line 240
Mode = 'run'if Redo_initialization thenRedo_initialization = nillove.run() -- won't actually replace the event loop;-- we're just running it for its initialization side-effectselseMode = 'run'end - replacement in live.lua at line 36
live.freeze_all_existing_definitions()if Live.frozen_definitions == nil then -- a second run due to initialization errors will contain definitions we don't want to freezelive.freeze_all_existing_definitions()end - edit in live.lua at line 85
if Redo_initialization thenRedo_initialization = nillove.run() -- won't actually replace the event loop;-- we're just running it for its initialization side-effectsend - edit in live.lua at line 402
function live.handle_initialization_error(err)Redo_initialization = truelive.handle_error(err)end - replacement in app.lua at line 39
-- Stash current state of App for testsApp_for_tests = {}for k,v in pairs(App) doApp_for_tests[k] = vend-- there's one nested tableApp_for_tests.screen = {}for k,v in pairs(App.screen) doApp_for_tests.screen[k] = v-- Stash initial state of App (right after loading files) for testsif App_for_tests == nil thenApp_for_tests = {}for k,v in pairs(App) doApp_for_tests[k] = vend-- there's one nested tableApp_for_tests.screen = {}for k,v in pairs(App.screen) doApp_for_tests.screen[k] = vend - replacement in app.lua at line 145
App.initialize(love.arg.parseGameArguments(arg), arg)xpcall(function() App.initialize(love.arg.parseGameArguments(arg), arg) end, live.handle_initialization_error) - edit in Manual_tests.md at line 65[21.1426][21.1426]
Driver can connect to app on errors in on.initialize. - edit in Manual_tests.md at line 67[21.1501][21.1501]
driver, define on.initialize with a run-time error:```on.initialize = function()foo = bar+1end```Hit F4.Quit the client app and restart. App shows an error.Edit `on.initialize` in the driver and remove the error:```on.initialize = function()end```Hit F4. The error disappears from the app and driver.* clone this repo to a new client app, clear its save dir, run it, run thedriver, define on.initialize with a run-time error:```on.initialize = function()foo = bar+1end```Hit F4.Quit the client app and restart. App shows an error.Hit F4 again in the driver (without fixing the error).The client app continues to show the error.* clone this repo to a new client app, clear its save dir, run it, run the