diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-05 18:41:53 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-05 18:41:53 -0500 |
commit | cbc5fbdf941cd40dc6a9546fb924689f5d6978c7 (patch) | |
tree | 734bfa515ddeab208c35c50624cfd9f1124ce6cf /runner.go | |
parent | 05ce22f9d2308bca51b48fb60558d17f2e381227 (diff) | |
download | planr-cbc5fbdf941cd40dc6a9546fb924689f5d6978c7.tar.xz planr-cbc5fbdf941cd40dc6a9546fb924689f5d6978c7.zip |
Improvised a basic text report, finished evaluation mappings
Diffstat (limited to 'runner.go')
-rw-r--r-- | runner.go | 38 |
1 files changed, 25 insertions, 13 deletions
@@ -27,15 +27,22 @@ func (r Runner) buildTcLUT(tcs []TestCase) TcTab { for i := range tcs { tc := &tcs[i] - for nm := range tc.Config.adapters_ { - m[nm] = append(m[nm], tc) - } + nm := *tc.Config.Adapter + m[nm] = append(m[nm], tc) } return m } -func (r Runner) Build(tcs []TestCase) { +func (r Runner) checkConfig(tcs []TestCase) { + for _, tc := range tcs { + tc.Config.ensureSatisfied(tc.Path) + } +} + +func (r Runner) build(tcs []TestCase) { + r.checkConfig(tcs) + tcTab := r.buildTcLUT(tcs) for _, adapter := range r.adapters { @@ -46,9 +53,17 @@ func (r Runner) Build(tcs []TestCase) { } } -func (r Runner) Evaluate(tcs []TestCase) []TestResult { +func (r Runner) units(root string) []TestCase { + return collectUnits(root, r.adapterCfgs()) +} + +func (r Runner) Build(root string) { + units := r.units(root) + r.build(units) +} + +func (r Runner) evaluate(tcs []TestCase) { tcTab := r.buildTcLUT(tcs) - results := make([]TestResult, 0) for _, adapter := range r.adapters { nm := adapter.Config().Name @@ -57,15 +72,12 @@ func (r Runner) Evaluate(tcs []TestCase) []TestResult { adapter.Evaluate(tcTab[nm]) } - return results } +func (r Runner) Evaluate(root string) []TestCase { + units := r.units(root) -func (r Runner) Run(root string) [] TestResult { - tcs := collectUnits(root, r.adapterCfgs()) - - r.Build(tcs) - trs := r.Evaluate(tcs) + r.evaluate(units) - return trs + return units } |