aboutsummaryrefslogtreecommitdiff
path: root/runner.go
diff options
context:
space:
mode:
Diffstat (limited to 'runner.go')
-rw-r--r--runner.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/runner.go b/runner.go
index 96bcd19..3bee17a 100644
--- a/runner.go
+++ b/runner.go
@@ -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 {