Change Output Locations
This commit is contained in:
@@ -3640,8 +3640,8 @@ func TestBuildNativeRemovesStaleTopdataOutputs(t *testing.T) {
|
||||
]
|
||||
}`+"\n")
|
||||
writeFile(t, filepath.Join(root, "topdata", "data", "repadjust", "lock.json"), "{}\n")
|
||||
mkdirAll(t, filepath.Join(root, "build", "topdata", "2da"))
|
||||
writeFile(t, filepath.Join(root, "build", "topdata", "2da", "stale.2da"), "stale\n")
|
||||
mkdirAll(t, filepath.Join(root, "topdata", "assets", "2da"))
|
||||
writeFile(t, filepath.Join(root, "topdata", "assets", "2da", "stale.2da"), "stale\n")
|
||||
|
||||
p := testProject(root)
|
||||
p.Config.TopData.ReferenceBuilder = ""
|
||||
@@ -3654,6 +3654,38 @@ func TestBuildNativeRemovesStaleTopdataOutputs(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildNativeWritesCompiledOutputsToAssetsAndBuild(t *testing.T) {
|
||||
root := testProjectRoot(t)
|
||||
mkdirAll(t, filepath.Join(root, "topdata", "data", "repadjust"))
|
||||
writeFile(t, filepath.Join(root, "topdata", "base_dialog.json"), "{}\n")
|
||||
writeFile(t, filepath.Join(root, "topdata", "data", "repadjust", "base.json"), `{
|
||||
"output": "repadjust.2da",
|
||||
"columns": ["LABEL"],
|
||||
"rows": [
|
||||
{"id": 0, "LABEL": "TEST"}
|
||||
]
|
||||
}`+"\n")
|
||||
|
||||
p := testProject(root)
|
||||
p.Config.TopData.ReferenceBuilder = ""
|
||||
result, err := BuildNative(p, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("BuildNative failed: %v", err)
|
||||
}
|
||||
if got, want := result.Output2DADir, filepath.Join(root, "topdata", "assets", "2da"); got != want {
|
||||
t.Fatalf("unexpected 2da output dir: got %q want %q", got, want)
|
||||
}
|
||||
if got, want := result.OutputTLKDir, filepath.Join(root, "build"); got != want {
|
||||
t.Fatalf("unexpected tlk output dir: got %q want %q", got, want)
|
||||
}
|
||||
if _, err := os.Stat(filepath.Join(result.Output2DADir, "repadjust.2da")); err != nil {
|
||||
t.Fatalf("expected compiled 2da output: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(filepath.Join(result.OutputTLKDir, defaultTLKName)); err != nil {
|
||||
t.Fatalf("expected compiled tlk output: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateAndBuildTopdataDoNotRequireReferenceBuilder(t *testing.T) {
|
||||
root := testProjectRoot(t)
|
||||
mkdirAll(t, filepath.Join(root, "topdata", "data", "repadjust"))
|
||||
|
||||
Reference in New Issue
Block a user