Files
aego/tests/integration/editor_settle_test.go
sanspie 867efcf2f8
ci-platforms / windows amd64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / checks (push) Failing after 44m58s
ci-platforms / darwin amd64 smoke (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m46s
ci / release (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
GitHub / linux amd64 native GitHub-hosted native CI: success
test: synchronize idle allocations and camera probe
2026-11-10 13:15:15 +03:00

53 lines
1.4 KiB
Go

package integration
import (
"testing"
"aego/editor/core/context"
)
type heldScriptRefresh struct {
context.ScriptNav
refreshing bool
}
func (h *heldScriptRefresh) Refreshing() bool { return h.refreshing }
func TestEditorSettledWaitsForScriptRefresh(t *testing.T) {
s := workspaceSession(t)
waitEditorSettled(t, s)
ctx := s.App.Context()
if ctx.Code == nil {
t.Fatal("the editor has no script host")
}
original := ctx.Code
defer func() { ctx.Code = original }()
held := &heldScriptRefresh{ScriptNav: original, refreshing: true}
ctx.Code = held
if editorSettled(s) {
t.Fatal("editor was considered settled while script analysis was still refreshing")
}
held.refreshing = false
waitEditorSettled(t, s)
}
var frameAllocationSink *[128]byte
func TestEditorFrameAllocsDetectsAddedAllocations(t *testing.T) {
skipUnderRace(t)
s := workspaceSession(t)
assets := s.App.AssetsPanel()
before := assets.DirectoryRefreshes()
baseline := editorFrameAllocs(t, s, func() { s.Step() })
if assets.DirectoryRefreshes() <= before {
t.Fatal("the allocation window did not wait for a real Assets refresh")
}
withAllocation := editorFrameAllocs(t, s, func() {
s.Step()
frameAllocationSink = new([128]byte)
})
if withAllocation <= baseline {
t.Fatalf("an allocation on every frame went undetected: baseline=%v with allocation=%v", baseline, withAllocation)
}
}