mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
Add GUT (CLI only) and remove gd-plug
Commit GUT directly to the git repo and remove gd-plug as it is no longer required to install GUT. Modify GUT to be used by command-line only. For example: ``` cp test/.gutconfig.ci.json .gutconfig.json godot --no-window -s addons/gut/gut_cmdln.gd ```
This commit is contained in:
parent
b14ea64492
commit
d784b53e25
52 changed files with 11394 additions and 1174 deletions
44
addons/gut/parameter_handler.gd
Normal file
44
addons/gut/parameter_handler.gd
Normal file
|
@ -0,0 +1,44 @@
|
|||
var _utils = load("res://addons/gut/utils.gd").get_instance()
|
||||
var _params = null
|
||||
var _call_count = 0
|
||||
var _logger = null
|
||||
|
||||
|
||||
func _init(params = null):
|
||||
_params = params
|
||||
_logger = _utils.get_logger()
|
||||
if typeof(_params) != TYPE_ARRAY:
|
||||
_logger.error("You must pass an array to parameter_handler constructor.")
|
||||
_params = null
|
||||
|
||||
|
||||
func next_parameters():
|
||||
_call_count += 1
|
||||
return _params[_call_count - 1]
|
||||
|
||||
|
||||
func get_current_parameters():
|
||||
return _params[_call_count]
|
||||
|
||||
|
||||
func is_done():
|
||||
var done = true
|
||||
if _params != null:
|
||||
done = _call_count == _params.size()
|
||||
return done
|
||||
|
||||
|
||||
func get_logger():
|
||||
return _logger
|
||||
|
||||
|
||||
func set_logger(logger):
|
||||
_logger = logger
|
||||
|
||||
|
||||
func get_call_count():
|
||||
return _call_count
|
||||
|
||||
|
||||
func get_parameter_count():
|
||||
return _params.size()
|
Loading…
Add table
Add a link
Reference in a new issue