beta-1.4/persistence-implementation (#3)
Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
28
Debug/Unit Testing/Scripts/base_test_runner.gd
Normal file
28
Debug/Unit Testing/Scripts/base_test_runner.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends Node
|
||||
class_name BaseTestRunner
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var methods := self.get_method_list()
|
||||
for method in methods:
|
||||
var method_name: String = method["name"]
|
||||
if method_name.left(5).to_lower() != "test_":
|
||||
continue
|
||||
|
||||
var return_dict: Dictionary = method["return"]
|
||||
var return_type: int = return_dict["type"]
|
||||
|
||||
if return_type != 1:
|
||||
print_rich("[color=yellow]Skipping Unit Test Method '%s'. Reason: Return type is not bool[/color]" % method_name)
|
||||
continue
|
||||
|
||||
var args: Array = method["args"]
|
||||
if not args.is_empty():
|
||||
print_rich("[color=yellow]Skipping Unit Test Method '%s', Reason: Method requires arguments.[/color]" % method_name)
|
||||
continue
|
||||
|
||||
var result: bool = call(method_name)
|
||||
if result:
|
||||
print_rich("[color=green]%s: Success![/color]" % method_name)
|
||||
else:
|
||||
print_rich("[color=red]%s: Failure...[/color]" % method_name)
|
||||
Reference in New Issue
Block a user