mirror of
https://github.com/Relintai/regression-test-project.git
synced 2025-02-18 17:14:24 +01:00
Force to show all functions (#50)
This commit is contained in:
parent
7177d6034a
commit
a02f53255e
@ -12,6 +12,8 @@ var time_to_show: int = 25 * 1000 # How long test works in miliseconds
|
|||||||
|
|
||||||
var time_for_each_step: int = -1
|
var time_for_each_step: int = -1
|
||||||
|
|
||||||
|
var can_be_closed: bool = true
|
||||||
|
|
||||||
# Each scene runs alone
|
# Each scene runs alone
|
||||||
const alone_steps: Array = [
|
const alone_steps: Array = [
|
||||||
"res://Nodes/Nodes.tscn",
|
"res://Nodes/Nodes.tscn",
|
||||||
@ -21,6 +23,7 @@ const alone_steps : Array = [
|
|||||||
"res://AutomaticBugs/FunctionExecutor.tscn", # Only runs
|
"res://AutomaticBugs/FunctionExecutor.tscn", # Only runs
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
func _init():
|
func _init():
|
||||||
start_time = OS.get_ticks_msec()
|
start_time = OS.get_ticks_msec()
|
||||||
|
|
||||||
@ -43,6 +46,6 @@ func _process(delta: float) -> void:
|
|||||||
print("Test is running now " + str(int(time_to_print_next_time / 1000)) + " seconds")
|
print("Test is running now " + str(int(time_to_print_next_time / 1000)) + " seconds")
|
||||||
time_to_print_next_time += PRINT_TIME_EVERY_MILISECONDS
|
time_to_print_next_time += PRINT_TIME_EVERY_MILISECONDS
|
||||||
|
|
||||||
if current_run_time > time_to_show:
|
if current_run_time > time_to_show && can_be_closed:
|
||||||
print("######################## Ending test ########################")
|
print("######################## Ending test ########################")
|
||||||
get_tree().quit()
|
get_tree().quit()
|
||||||
|
6
Start.gd
6
Start.gd
@ -6,13 +6,19 @@ const NUMBER_OF_INSTANCES : int = 1 # Use more than 1 to stress test, 1 should b
|
|||||||
|
|
||||||
var array_with_time_to_change: Array = []
|
var array_with_time_to_change: Array = []
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
Autoload.can_be_closed = false
|
||||||
|
|
||||||
for i in Autoload.alone_steps.size() + 1:
|
for i in Autoload.alone_steps.size() + 1:
|
||||||
array_with_time_to_change.append(OS.get_ticks_msec() + i * Autoload.time_for_each_step)
|
array_with_time_to_change.append(OS.get_ticks_msec() + i * Autoload.time_for_each_step)
|
||||||
|
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
if current_scene < Autoload.alone_steps.size() - 1 && OS.get_ticks_msec() > array_with_time_to_change[current_scene + 1]:
|
if current_scene < Autoload.alone_steps.size() - 1 && OS.get_ticks_msec() > array_with_time_to_change[current_scene + 1]:
|
||||||
current_scene += 1
|
current_scene += 1
|
||||||
|
if current_scene == Autoload.alone_steps.size() - 1:
|
||||||
|
Autoload.can_be_closed = true
|
||||||
|
|
||||||
for child in get_children():
|
for child in get_children():
|
||||||
child.queue_free()
|
child.queue_free()
|
||||||
|
Loading…
Reference in New Issue
Block a user