Migrate to functions for delivering test results

This commit is contained in:
JeremyStar™ 2024-03-29 02:56:30 +01:00
parent 642c3a62a9
commit 7e050aa6ab
3 changed files with 15 additions and 38 deletions

View file

@ -5,36 +5,13 @@ extends BessereTestsTest
#func before_each() -> void: ldiag("before_each() called")
#func after_each() -> void: ldiag("after_each() called")
func test_ok() -> void:
test_status = 0
test_message = "test_ok with a message"
func test_ok_nm() -> void:
test_status = 0
func test_warn() -> void:
test_status = 1
test_message = "test_warn with a message"
func test_warn_nm() -> void:
test_status = 1
func test_error() -> void:
test_status = 2
test_message = "test_error with a message"
func test_error_nm() -> void:
test_status = 2
func test_skip() -> void:
test_status = 3
test_message = "test_skip with a message"
func test_skip_nm() -> void:
test_status = 3
func test_forgot() -> void:
pass
func test_invalid() -> void:
test_status = 69
func test_ok() -> void: rok("test_ok with a message")
func test_ok_nm() -> void: rok()
func test_warn() -> void: rwarn("test_warn with a message")
func test_warn_nm() -> void: rwarn()
func test_error() -> void: rerror("test_error with a message")
func test_error_nm() -> void: rerror()
func test_skip() -> void: rskip("test_skip with a message")
func test_skip_nm() -> void: rskip()
func test_forgot() -> void: pass
func test_invalid() -> void: test_status = 69

View file

@ -6,4 +6,4 @@ func test_logging() -> void:
linfo("INFORMATIONAL MESSAGE")
lwarn("WARNING MESSAGE")
lerror("ERROR MESSAGE")
test_status = 0
rok()

View file

@ -1,9 +1,9 @@
extends BessereTestsTest
func test_boolean() -> void:
if is_inside_tree(): test_status = 0
else: test_status = 2
if is_inside_tree(): rok()
else: rerror()
func test_existance() -> void:
if get_tree() == null: test_status = 2
else: test_status = 0
if get_tree() == null: rerror()
else: rok()