ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (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
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 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 / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Add dockable Art tools, animation and previews, guarded asset workflows, and the Web Asset Studio built on the shared Art Core. Expand English and Russian documentation, interactive Try scenes, examples and editor icons. Add audio waveform navigation, source analysis, guarded previews and a browser Worker mixer. Preserve source changes and recovery with bounded checks, and strengthen native, browser and interoperability CI. Prepare version 0.12.5 and manually built native artifact candidates. Fix the production site image demo build dependency. Reuse immutable scene indices when capturing keyframes. Wait for real Persist save/load completion in component tests. Stabilize browser Game View captures outside pointer hover. Aseprite interchange and persistent Audio EDL recovery remain limited; the artifact workflow does not publish releases or change stable.
149 lines
5.9 KiB
Go
149 lines
5.9 KiB
Go
//go:build !aego_runtime
|
|
|
|
package docs_test
|
|
|
|
import (
|
|
"os"
|
|
"slices"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestDocumentedExportTargetsMatchCommandUsage(t *testing.T) {
|
|
command, err := os.ReadFile("../../cmd/aego/export.go")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
const targets = "host|linux|windows|darwin[/amd64|/arm64]|web"
|
|
if !strings.Contains(string(command), "--target "+targets) {
|
|
t.Fatal("export command contract changed; review the documentation")
|
|
}
|
|
for _, name := range []string{"cli.md", "cli.ru.md"} {
|
|
data, err := os.ReadFile("../../engine/res/docs/" + name)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if !strings.Contains(strings.ReplaceAll(string(data), `\|`, "|"), "--target "+targets) {
|
|
t.Errorf("%s omits a supported export target", name)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestPhysicsAdviceKeepsQueuedActionEdges(t *testing.T) {
|
|
r, _ := build(t)
|
|
e, ok := r.Get("physics/pitfalls")
|
|
if !ok {
|
|
t.Fatal("missing physics pitfalls")
|
|
}
|
|
if strings.Contains(e.Body, "Read it in `Update`") || strings.Contains(e.Translations["ru"].Body, "Читайте его в `Update`") {
|
|
t.Fatal("obsolete workaround for action edges returned")
|
|
}
|
|
for _, body := range []string{e.Body, e.Translations["ru"].Body} {
|
|
if !strings.Contains(body, `input.Pressed("Jump")`) || !strings.Contains(body, "`FixedUpdate`") || !strings.Contains(body, "`input.Down`") {
|
|
t.Fatal("advice must distinguish a queued edge from holding")
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestPostProcessDocumentsNamedParametersAndDiagnosticCauses(t *testing.T) {
|
|
r, _ := build(t)
|
|
for _, method := range []string{"SetFloat", "SetInt", "SetBool", "SetVec2", "SetVec3", "SetVec4", "SetEffectEnabled"} {
|
|
e, ok := r.Get("render2d.PostProcess." + method)
|
|
if !ok || len(e.Params) != 2 || e.Params[0].Name == "p0" || e.Params[1].Name == "p1" || strings.Contains(e.Signature, "struct:") {
|
|
t.Errorf("undocumented parameters: %+v", e)
|
|
}
|
|
}
|
|
for _, id := range []string{"MAT004", "SHD009"} {
|
|
e, ok := r.Get(id)
|
|
if !ok || e.Diag == nil || e.Translations["ru"].Body == "" {
|
|
t.Errorf("missing diagnostic %s or its translation", id)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestOwnSourceAndRuntimeFormatsHaveBilingualReferencePages(t *testing.T) {
|
|
r, _ := build(t)
|
|
for _, name := range []string{"aego", "aescene", "aeprefab", "aes", "aeart", "aeanim", "aectrl", "aepreset", "aedata", "aetable", "aemat", "aeshader", "meta", "aetext"} {
|
|
e, ok := r.Get("formats/" + name)
|
|
if !ok || e.Parent != "formats/source" || e.Summary == "" || e.Translations["ru"].Body == "" {
|
|
t.Errorf("missing source-format page or translation: %s: %+v", name, e)
|
|
}
|
|
}
|
|
for _, name := range []string{"artifacts", "aetry", "aesave"} {
|
|
e, ok := r.Get("formats/" + name)
|
|
if !ok || e.Parent != "formats/runtime" || e.Translations["ru"].Body == "" {
|
|
t.Errorf("runtime format %s is missing or mixed with authoring sources", name)
|
|
}
|
|
}
|
|
if _, exists := r.Get("module/"); exists {
|
|
t.Fatal("a schema value created an empty module group")
|
|
}
|
|
for _, id := range []string{"particles.ColorKey", "render2d.PostEffect", "render2d.PostParameter"} {
|
|
e, ok := r.Get(id)
|
|
if !ok || !e.ValueType || e.Owner == "" || e.Component != nil {
|
|
t.Errorf("value type masquerades as a component: %s: %+v", id, e)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestPublicValueFieldsHaveBilingualDescriptions(t *testing.T) {
|
|
r, _ := build(t)
|
|
for parent, fields := range map[string][]string{
|
|
"aego/audio.PlayOptions": {"Bus", "FadeIn", "Loop", "Pan", "Pitch", "Priority", "Unscaled", "Volume"},
|
|
"aego/camera.Pose": {"Position", "Rotation", "Zoom"},
|
|
"aego/data.AudioEvent": {"Bus", "Cooldown", "Loop", "MaxDistance", "MaxVoices", "MinDistance", "PanWidth", "PauseWith", "Pitch", "PitchRand", "Priority", "Spatial", "Steal", "Volume", "VolumeRand"},
|
|
"aego/material.Vec4": {"X", "Y", "Z", "W"},
|
|
"aego/physics.Contact": {"Point", "Normal", "NormalImpulse", "RelativeVelocity", "SelfCollider", "OtherCollider"},
|
|
"aego/physics.RayHit": {"Hit", "Point", "Normal", "Distance", "Node", "Collider"},
|
|
"engine.MaterialParameter": {"Name", "Kind", "Value", "Integer", "Boolean"},
|
|
} {
|
|
for _, field := range fields {
|
|
id := parent + "." + field
|
|
e, ok := r.Get(id)
|
|
if !ok || e.Summary == "" || e.Body == "" || e.Translations["ru"].Body == "" {
|
|
t.Errorf("public value field %s needs EN/RU prose", id)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestMaterialOverrideDocumentsParameterScopesAndCheckedScene(t *testing.T) {
|
|
r, _ := build(t)
|
|
for method, names := range map[string][]string{
|
|
"SetFloat": {"name", "value"}, "SetInt": {"name", "value"}, "SetBool": {"name", "value"},
|
|
"SetVec2": {"name", "value"}, "SetVec3": {"name", "value"}, "SetVec4": {"name", "value"}, "SetColor": {"name", "value"},
|
|
"GetFloat": {"name"}, "GetInt": {"name"}, "GetBool": {"name"}, "GetVec2": {"name"}, "GetVec3": {"name"},
|
|
"GetVec4": {"name"}, "GetColor": {"name"}, "GetVec4Lane": {"name", "lane"}, "Reset": {"name"},
|
|
} {
|
|
e, ok := r.Get("engine.MaterialOverride." + method)
|
|
var got []string
|
|
for _, p := range e.Params {
|
|
got = append(got, p.Name)
|
|
}
|
|
if !ok || !slices.Equal(got, names) || e.Translations["ru"].Body == "" {
|
|
t.Errorf("MaterialOverride.%s has unnamed parameters or no RU explanation: %+v", method, e)
|
|
}
|
|
}
|
|
e, _ := r.Get("engine.MaterialOverride")
|
|
checked := map[string]bool{}
|
|
for _, snippet := range e.Snippets {
|
|
if snippet.Check {
|
|
checked[snippet.Lang] = true
|
|
}
|
|
}
|
|
if !checked["aes"] || !checked["aescene"] || !strings.Contains(e.Body, "FlashProbe") {
|
|
t.Fatal("MaterialOverride example must compile and run with its actual scene setup")
|
|
}
|
|
for _, body := range []string{e.Body, e.Translations["ru"].Body} {
|
|
for _, token := range []string{"@instance", "int32", "Reset", "PostProcess"} {
|
|
if !strings.Contains(body, token) {
|
|
t.Errorf("material override guide omits %q", token)
|
|
}
|
|
}
|
|
}
|
|
data, _ := r.Get("data")
|
|
if strings.Contains(data.Body, `asset("…")`) || strings.Contains(data.Translations["ru"].Body, `asset("…")`) {
|
|
t.Fatal("data guide presents an invalid AssetID as a source example")
|
|
}
|
|
}
|