Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass beehave tree tests #314

Merged
merged 3 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified addons/beehave/libs/windows/beehave.windows.editor.x86_64.dll
Binary file not shown.
Binary file modified addons/beehave/libs/windows/~beehave.windows.editor.x86_64.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/gdUnit4/GdUnitRunner.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"included":{"res://test/beehave_tree_test.gd":[]},"server_port":31002,"skipped":{},"version":"1.0"}
{"included":{"res://test/":[]},"server_port":31002,"skipped":{},"version":"1.0"}
25 changes: 18 additions & 7 deletions addons/gdUnit4/bin/GdUnitBuildTool.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
extends SceneTree

enum {
INIT, PROCESSING, EXIT
INIT,
PROCESSING,
EXIT
}

const RETURN_SUCCESS = 0
Expand All @@ -11,9 +13,19 @@ const RETURN_WARNING = 101

var _console := CmdConsole.new()
var _cmd_options: = CmdOptions.new([
CmdOption.new("-scp, --src_class_path", "-scp <source_path>", "The full class path of the source file.", TYPE_STRING),
CmdOption.new("-scl, --src_class_line", "-scl <line_number>", "The selected line number to generate test case.", TYPE_INT)
])
CmdOption.new(
"-scp, --src_class_path",
"-scp <source_path>",
"The full class path of the source file.",
TYPE_STRING
),
CmdOption.new(
"-scl, --src_class_line",
"-scl <line_number>",
"The selected line number to generate test case.",
TYPE_INT
)
])

var _status := INIT
var _source_file :String = ""
Expand Down Expand Up @@ -49,13 +61,11 @@ func _idle(_delta):
var script := ResourceLoader.load(_source_file) as Script
if script == null:
exit(RETURN_ERROR, "Can't load source file %s!" % _source_file)

var result := GdUnitTestSuiteBuilder.create(script, _source_line)
if result.is_error():
print_json_error(result.error_message())
exit(RETURN_ERROR, result.error_message())
return

_console.prints_color("Added testcase: %s" % result.value(), Color.CORNFLOWER_BLUE)
print_json_result(result.value())
exit(RETURN_SUCCESS)
Expand Down Expand Up @@ -86,7 +96,8 @@ func print_json_error(error :String) -> void:
func show_options() -> void:
_console.prints_color(" Usage:", Color.DARK_SALMON)
_console.prints_color(" build -scp <source_path> -scl <line_number>", Color.DARK_SALMON)
_console.prints_color("-- Options ---------------------------------------------------------------------------------------", Color.DARK_SALMON).new_line()
_console.prints_color("-- Options ---------------------------------------------------------------------------------------",
Color.DARK_SALMON).new_line()
for option in _cmd_options.default_options():
descripe_option(option)

Expand Down
Loading
Loading