make the extra_fns functionality clearer

develop
myk002 2022-06-06 16:38:40 -07:00 committed by Myk
parent f1ebfe9441
commit c940f086b5
2 changed files with 9 additions and 5 deletions

@ -2,4 +2,4 @@
description=integration test for the gui/quantum script description=integration test for the gui/quantum script
width=5 width=5
height=5 height=5
extra_fn=test_gui_quantum extra_fn=gui_quantum

1 #notes
2 description=integration test for the gui/quantum script
3 width=5
4 height=5
5 extra_fn=test_gui_quantum extra_fn=gui_quantum

@ -10,8 +10,10 @@
-- height (required) -- height (required)
-- depth (default is 1) -- depth (default is 1)
-- start (cursor offset for input blueprints, default is 1,1) -- start (cursor offset for input blueprints, default is 1,1)
-- extra_fn (the name of a global function in this file to run after applying -- extra_fn (the name of a function in the extra_fns table in this file to
-- all blueprints but before comparing results) -- run after applying all blueprints but before comparing results.
-- this function will get the map coordinate of the upper-left
-- corner of the test area passed to it)
-- --
-- depends on blueprint, buildingplan, and dig-now plugins (as well as the -- depends on blueprint, buildingplan, and dig-now plugins (as well as the
-- quickfort script and anything else run in the extra_fns, of course) -- quickfort script and anything else run in the extra_fns, of course)
@ -301,6 +303,8 @@ local function do_dig_phase(phase_data, area, spec)
run_dig_now(area) run_dig_now(area)
end end
local extra_fns = {}
function test.end_to_end() function test.end_to_end()
-- read in test plan -- read in test plan
local sets = get_blueprint_sets() local sets = get_blueprint_sets()
@ -330,7 +334,7 @@ function test.end_to_end()
-- run any extra commands, if defined by the blueprint spec -- run any extra commands, if defined by the blueprint spec
if spec.extra_fn then if spec.extra_fn then
_ENV[spec.extra_fn](area.pos) extra_fns[spec.extra_fn](area.pos)
end end
-- run blueprint to generate files in output dir -- run blueprint to generate files in output dir
@ -387,7 +391,7 @@ local function send_keys(...)
end end
end end
function test_gui_quantum(pos) function extra_fns.gui_quantum(pos)
local vehicles = assign_minecarts.get_free_vehicles() local vehicles = assign_minecarts.get_free_vehicles()
local confirm_state = confirm.isEnabled() local confirm_state = confirm.isEnabled()
local confirm_conf = confirm.get_conf_data() local confirm_conf = confirm.get_conf_data()