diff options
Diffstat (limited to 'runner.go')
-rw-r--r-- | runner.go | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -1,6 +1,9 @@ package planr -import "fmt" +import ( + "log" + "os" +) type Runner struct { adapters []Adapter @@ -40,6 +43,14 @@ func (r Runner) checkConfig(tcs []TestCase) { } } +func cdBuild(adapter Adapter) { + dir := adapter.Config().Dir() + + if err := os.Chdir(dir); err != nil { + log.Fatal(err) + } +} + func (r Runner) build(tcs []TestCase) { r.checkConfig(tcs) @@ -47,8 +58,8 @@ func (r Runner) build(tcs []TestCase) { for _, adapter := range r.adapters { nm := adapter.Config().Name - - fmt.Printf("[R] Building adapter \"%s\"\n", nm) + cdBuild(adapter) + adapter.Build(tcTab[nm]) } } @@ -67,11 +78,10 @@ func (r Runner) evaluate(tcs []TestCase) { for _, adapter := range r.adapters { nm := adapter.Config().Name + cdBuild(adapter) - fmt.Printf("[R] Evaluating adapter \"%s\"\n", nm) adapter.Evaluate(tcTab[nm]) } - } func (r Runner) Evaluate(root string) []TestCase { |