Head Accessories AutoGen Configuration
This commit is contained in:
@@ -196,6 +196,52 @@ func TestValidateLayoutRejectsInvalidTopDataPackageOutputNames(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateLayoutRejectsInvalidAutogenConsumerConfig(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", Build: "build"},
|
||||
Autogen: AutogenConfig{
|
||||
Consumers: []AutogenConsumerConfig{
|
||||
{
|
||||
ID: "head_visualeffects",
|
||||
Producer: "head_visualeffects",
|
||||
Dataset: "visualeffects",
|
||||
Mode: "unsupported",
|
||||
Root: "vfxs",
|
||||
Include: []string{"head_accessories/**/*.mdl"},
|
||||
Derive: AutogenDeriveConfig{Kind: "model_stem", GroupFrom: "first_path_segment"},
|
||||
Manifest: AutogenManifestConfig{
|
||||
ReleaseTag: "head-vfx-manifest-current",
|
||||
AssetName: "nested/sow-head-vfx-manifest.json",
|
||||
CacheName: "sow-head-vfx-manifest.txt",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
err := proj.ValidateLayout()
|
||||
if err == nil {
|
||||
t.Fatal("expected autogen validation error")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "autogen.consumers[0].mode") {
|
||||
t.Fatalf("expected autogen mode validation error, got %v", err)
|
||||
}
|
||||
if !strings.Contains(err.Error(), "autogen.consumers[0].manifest.asset_name") {
|
||||
t.Fatalf("expected autogen asset_name validation error, got %v", err)
|
||||
}
|
||||
if !strings.Contains(err.Error(), "autogen.consumers[0].manifest.cache_name") {
|
||||
t.Fatalf("expected autogen cache_name validation error, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScanAllowsMissingAssetsDir(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
mkdirAll(t, filepath.Join(root, "src"))
|
||||
|
||||
Reference in New Issue
Block a user