summaryrefslogtreecommitdiff
path: root/addons/gut/gut_config.gd
diff options
context:
space:
mode:
authorSophia Pearson <codergal89@gmail.com>2022-09-05 20:35:53 +0200
committerSophia Pearson <codergal89@gmail.com>2022-09-05 20:35:53 +0200
commitf20bd89dc4a7bf14a88b1effcaa1887b29314525 (patch)
treed114787f68efd2a7d61d95fa9c84e8e5d69a7c11 /addons/gut/gut_config.gd
parent1b477b62f8be8c546a35dbd1d2688ebf623c496f (diff)
downloadtexty-f20bd89dc4a7bf14a88b1effcaa1887b29314525.tar.xz
texty-f20bd89dc4a7bf14a88b1effcaa1887b29314525.zip
gui: split GUI into Terminal components
Diffstat (limited to 'addons/gut/gut_config.gd')
-rw-r--r--addons/gut/gut_config.gd29
1 files changed, 21 insertions, 8 deletions
diff --git a/addons/gut/gut_config.gd b/addons/gut/gut_config.gd
index 7a582d3..26a568f 100644
--- a/addons/gut/gut_config.gd
+++ b/addons/gut/gut_config.gd
@@ -45,7 +45,11 @@ var default_options = {
var default_panel_options = {
font_name = 'CourierPrime',
- font_size = 30
+ font_size = 30,
+ hide_result_tree = false,
+ hide_output_text = false,
+ hide_settings = false,
+ use_colors = true
}
var options = default_options.duplicate()
@@ -86,13 +90,21 @@ func _load_options_from_config_file(file_path, into):
# Get all the options out of the config file using the option name. The
# options hash is now the default source of truth for the name of an option.
- for key in into:
- if(results.result.has(key)):
- if(results.result[key] != null):
- into[key] = results.result[key]
+ _load_dict_into(results.result, into)
return 1
+func _load_dict_into(source, dest):
+ for key in dest:
+ if(source.has(key)):
+ if(source[key] != null):
+ if(typeof(source[key]) == TYPE_DICTIONARY):
+ _load_dict_into(source[key], dest[key])
+ else:
+ dest[key] = source[key]
+
+
+
func write_options(path):
var content = JSON.print(options, ' ')
@@ -125,15 +137,16 @@ func _apply_options(opts, _tester):
_tester.set_log_level(opts.log_level)
_tester.set_ignore_pause_before_teardown(opts.ignore_pause)
+ if(opts.selected != ''):
+ _tester.select_script(opts.selected)
+ # _run_single = true
+
for i in range(opts.dirs.size()):
_tester.add_directory(opts.dirs[i], opts.prefix, opts.suffix)
for i in range(opts.tests.size()):
_tester.add_script(opts.tests[i])
- if(opts.selected != ''):
- _tester.select_script(opts.selected)
- # _run_single = true
if(opts.double_strategy == 'full'):
_tester.set_double_strategy(DOUBLE_STRATEGY.FULL)