Native Workflow Support
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package pipeline
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"gitea.westgate.pw/ShadowsOverWestgate/sow-tools/internal/erf"
|
||||
"gitea.westgate.pw/ShadowsOverWestgate/sow-tools/internal/gff"
|
||||
"gitea.westgate.pw/ShadowsOverWestgate/sow-tools/internal/project"
|
||||
)
|
||||
|
||||
func TestDebugModuleIFO(t *testing.T) {
|
||||
root := "/home/vicky/Projects/sow-ShadowsOverWestgate/repositories/sow-module"
|
||||
p, err := project.Load(root)
|
||||
if err != nil { t.Fatal(err) }
|
||||
if err := p.Scan(); err != nil { t.Fatal(err) }
|
||||
exp, err := expectedResources(p)
|
||||
if err != nil { t.Fatal(err) }
|
||||
gotArchive, err := readArchive(filepath.Join(p.BuildDir(), p.Config.Module.ResRef+".mod"))
|
||||
if err != nil { t.Fatal(err) }
|
||||
got := archiveIndex(gotArchive)
|
||||
e := exp["module.ifo"].Bytes
|
||||
a := got["module.ifo"].Data
|
||||
fmt.Printf("EQUAL=%v\n", bytes.Equal(e,a))
|
||||
fmt.Printf("EXPECTED=%s\n", string(e))
|
||||
fmt.Printf("ACTUAL=%s\n", string(a))
|
||||
|
||||
var edoc gff.Document
|
||||
sourceRaw, _ := os.ReadFile(filepath.Join(root, "src/module/module.ifo.json"))
|
||||
_ = json.Unmarshal(sourceRaw, &edoc)
|
||||
fmt.Printf("SOURCE=%s\n", string(sourceRaw))
|
||||
|
||||
mod, _ := erf.Read(bytes.NewReader(mustRead(filepath.Join(p.BuildDir(), p.Config.Module.ResRef+".mod"))))
|
||||
_ = mod
|
||||
}
|
||||
|
||||
func mustRead(path string) []byte { b, _ := os.ReadFile(path); return b }
|
||||
Reference in New Issue
Block a user