Move Generation Destinations

This commit is contained in:
2026-04-18 10:24:34 +02:00
parent 897776f432
commit 6f6bf7080a
10 changed files with 166 additions and 91 deletions
+23
View File
@@ -82,6 +82,29 @@ func TestTopDataAssetsDirReturnsEmptyForNoConfig(t *testing.T) {
}
}
func TestValidateLayoutCreatesMissingCacheAssetsDir(t *testing.T) {
root := t.TempDir()
mkdirAll(t, filepath.Join(root, "src"))
mkdirAll(t, filepath.Join(root, "build"))
proj := &Project{
Root: root,
Config: Config{
Module: ModuleConfig{Name: "Test", ResRef: "test"},
Paths: PathConfig{Source: "src", Assets: ".cache/module-assets", Build: "build"},
},
}
if err := proj.ValidateLayout(); err != nil {
t.Fatalf("ValidateLayout returned error: %v", err)
}
if info, err := os.Stat(filepath.Join(root, ".cache", "module-assets")); err != nil {
t.Fatalf("expected cache assets dir to be created: %v", err)
} else if !info.IsDir() {
t.Fatalf("expected cache assets path to be a directory")
}
}
func mkdirAll(t *testing.T, path string) {
t.Helper()
if err := os.MkdirAll(path, 0o755); err != nil {