Add comprehensive tests and optimizations for simulation and UI performance
- Introduced a new benchmark save script to create a stress test scenario with extreme values for simulation performance. - Added a full UI benchmark script to measure frame rates and performance metrics during UI interactions. - Implemented tests for coarse generations to ensure population transitions are handled correctly. - Created tests for extra parameters to validate the loading and application of configuration settings. - Developed simulation optimization tests to verify the efficiency of population drift and rounding mechanisms. - Added split optimization tests to ensure accurate allocation and rounding behavior in population management. - Included startup parameter tests to confirm the correct initialization of global parameters before scene readiness. - Enhanced the audit rounding ledger to compare selective and full rounding results for consistency.
This commit is contained in:
@@ -65,6 +65,28 @@ func run() -> void:
|
||||
check(stage.effects_player.stream == stage.effects_player._effects.window_open, "Opening a window plays its effect")
|
||||
stage._on_topmenu_button_pressed("World")
|
||||
check(stage.effects_player.stream == stage.effects_player._effects.window_close, "Closing a window plays its effect")
|
||||
stage.indicator_elapsed = 1.0
|
||||
stage.active_actions_elapsed = 1.0
|
||||
stage.tick_ui(0.0)
|
||||
var refreshes: int = stage.actions_refreshes
|
||||
stage.date_time.text = "unchanged"
|
||||
stage.active_actions_elapsed = 1.0
|
||||
stage.tick_ui(0.0)
|
||||
check(stage.actions_refreshes == refreshes, "Idle UI does not recalculate production limits")
|
||||
check(stage.date_time.text == "unchanged", "Idle UI does not reformat the clock")
|
||||
stage.owniverse.state.amount.H = 3456
|
||||
stage.owniverse.presentation.refresh(stage.owniverse.state, stage.owniverse.catalog)
|
||||
stage.tick_ui(0.0)
|
||||
check(hydrogen.description.text == "3 456", "A manual publication updates idle UI")
|
||||
check(stage.actions_refreshes == refreshes + 1, "A publication invalidates production limits")
|
||||
stage.active_actions_dirty = true
|
||||
stage.tick_ui(0.0)
|
||||
check(stage.actions_refreshes == refreshes + 2, "Selection invalidation refreshes limits immediately")
|
||||
var old_pointer: float = stage.world_indicators.pointers.Agg.position.x
|
||||
stage.owniverse.environment.modify_world_parameter("Agg", 1)
|
||||
stage.indicator_elapsed = 1.0
|
||||
stage.tick_ui(0.0)
|
||||
check(stage.world_indicators.pointers.Agg.position.x != old_pointer, "World parameter actions invalidate indicators")
|
||||
for entity in stage.owniverse.catalog.entities.values(): entity.free()
|
||||
stage.owniverse.free()
|
||||
scene.free()
|
||||
|
||||
Reference in New Issue
Block a user