aboutsummaryrefslogtreecommitdiff
path: root/runner.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-04 13:41:52 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-04 13:41:52 -0500
commitb3252d2bd488b5b58cf0e46151ff9db0721c5fc6 (patch)
treef79fa92b882a5c74d2581a57055ecee815103f83 /runner.go
parent8c803d453201c8b85172d984fc1aee9eb5af2173 (diff)
downloadplanr-b3252d2bd488b5b58cf0e46151ff9db0721c5fc6.tar.xz
planr-b3252d2bd488b5b58cf0e46151ff9db0721c5fc6.zip
Add runner initalization
Diffstat (limited to 'runner.go')
-rw-r--r--runner.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/runner.go b/runner.go
index 1cc509e..d3d4b08 100644
--- a/runner.go
+++ b/runner.go
@@ -69,19 +69,11 @@ func (r Runner) build(tcs []TestCase) {
safeCd(r.dirs.Config())
}
-func (r Runner) init_adapters() {
- for _, adapter := range r.adapters {
- adapter.Init(r.dirs)
- }
-}
-
func (r Runner) units() []TestCase {
return collectUnits(r.dirs.Rubric(), r.adapterCfgs())
}
func (r Runner) Build() {
- r.init_adapters()
-
units := r.units()
if !directoryExists(r.dirs.Build()) {
@@ -105,7 +97,6 @@ func (r Runner) evaluate(tcs []TestCase) {
}
func (r Runner) Evaluate() []TestCase {
- r.init_adapters()
units := r.units()
@@ -129,3 +120,13 @@ func (r Runner) ConfigDir() string {
func (r Runner) SrcDir() string {
return r.dirs.Src()
}
+
+func NewRunner(adapters []Adapter, dirs DirConfig) Runner {
+ r := Runner{adapters, dirs}
+
+ for _, adapter := range r.adapters {
+ adapter.Init(dirs)
+ }
+
+ return r
+}