perf: harden runtime for weaker hardware
This commit is contained in:
@@ -25,6 +25,9 @@ $CROSS_PLATFORM_PLUGIN_FILES = @(
|
||||
"addons/terrain_3d/bin/libterrain.windows.release.x86_64.dll"
|
||||
)
|
||||
$REQUIRED_GODOT_SERIES = "4.7"
|
||||
$RUNNING_ON_MACOS = [Runtime.InteropServices.RuntimeInformation]::IsOSPlatform(
|
||||
[Runtime.InteropServices.OSPlatform]::OSX
|
||||
)
|
||||
|
||||
function Exit-Quality {
|
||||
param([int]$ExitCode)
|
||||
@@ -182,6 +185,31 @@ function To-ResPath($p) {
|
||||
return "res://$p"
|
||||
}
|
||||
|
||||
function Test-AllowedScenarioDiagnostic {
|
||||
param([string]$Diagnostic)
|
||||
|
||||
# Godot 4.7 can fail to read the system certificate store on macOS when HOME
|
||||
# is intentionally isolated. Scenario tests do not perform network access.
|
||||
if ($script:RUNNING_ON_MACOS -and
|
||||
$Diagnostic -ceq 'ERROR: Condition "ret != noErr" is true. Returning: ""') {
|
||||
return $true
|
||||
}
|
||||
|
||||
# Pinned Terrain3D 1.0.2 invokes this Godot 4.7 compatibility method while
|
||||
# loading its vendored GDExtension. Remove this exception with that vendor fix.
|
||||
if ($Diagnostic -ceq 'WARNING: instance_reset_physics_interpolation() is deprecated.') {
|
||||
return $true
|
||||
}
|
||||
|
||||
# Godot 4.7's dummy headless renderer retains exactly one DummyShader RID at
|
||||
# process teardown. A different RID type or count remains a gate failure.
|
||||
if ($Diagnostic -ceq "ERROR: 1 RID allocations of type 'N13RendererDummy15MaterialStorage11DummyShaderE' were leaked at exit.") {
|
||||
return $true
|
||||
}
|
||||
|
||||
return $false
|
||||
}
|
||||
|
||||
function Invoke-GodotWithTimeout {
|
||||
param(
|
||||
[string]$ArgumentString,
|
||||
@@ -437,6 +465,36 @@ foreach ($test in $scenarioTests) {
|
||||
$ERRORS += "scenario: $($test.Name) failed or timed out"
|
||||
}
|
||||
}
|
||||
$compatibilityTest = "jajce_presentation_quality_test.gd"
|
||||
$compatibilityLabel = "$compatibilityTest (gl_compatibility)"
|
||||
Add-Content -Path "$LOG/scenarios.log" -Value "[RUN] $compatibilityLabel" -Encoding utf8
|
||||
$compatibilityArgs = "--headless --rendering-method gl_compatibility --path `"$ROOT`" --script res://tests/$compatibilityTest"
|
||||
$compatibilityOutput, $compatibilityExit = Invoke-GodotWithTimeout -ArgumentString $compatibilityArgs
|
||||
$compatibilityOutput | Add-Content -Path "$LOG/scenarios.log" -Encoding utf8
|
||||
if ($compatibilityExit -eq $null -or $compatibilityExit -ne 0) {
|
||||
$scenarioResult = "FAIL"
|
||||
$ERRORS += "scenario: $compatibilityLabel failed or timed out"
|
||||
}
|
||||
$unexpectedScenarioDiagnostics = @()
|
||||
$currentScenario = "unknown scenario"
|
||||
foreach ($rawLine in Get-Content -Path "$LOG/scenarios.log") {
|
||||
if ($rawLine.StartsWith('[RUN] ')) {
|
||||
$currentScenario = $rawLine.Substring(6)
|
||||
continue
|
||||
}
|
||||
$diagnostic = $rawLine.Trim()
|
||||
if ($diagnostic -cnotmatch '^(?:(?:SCRIPT )?ERROR|WARNING):') { continue }
|
||||
if (-not (Test-AllowedScenarioDiagnostic $diagnostic)) {
|
||||
$unexpectedScenarioDiagnostics += "$currentScenario`: $diagnostic"
|
||||
}
|
||||
}
|
||||
if ($unexpectedScenarioDiagnostics.Count -gt 0) {
|
||||
$scenarioResult = "FAIL"
|
||||
$ERRORS += "scenario: Godot reported $($unexpectedScenarioDiagnostics.Count) unallowlisted ERROR/WARNING diagnostic(s)"
|
||||
foreach ($diagnostic in $unexpectedScenarioDiagnostics | Select-Object -First 20) {
|
||||
$ERRORS += "scenario: $diagnostic"
|
||||
}
|
||||
}
|
||||
$scenarioLoadError = Select-String -Path "$LOG/scenarios.log" -Pattern 'SCRIPT ERROR:|Parse Error:|Failed to load script' -Quiet
|
||||
if ($scenarioLoadError) {
|
||||
$scenarioResult = "FAIL"
|
||||
|
||||
Reference in New Issue
Block a user