diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-04 14:32:22 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-04 14:32:22 -0500 |
commit | f90a14d5d723c5d2b87f2eaa19f441dec33bb9b2 (patch) | |
tree | e0abd76b6ebd9adcc60732d532cb68c512b0c2d1 /runner.go | |
parent | a0b020a78eb0b33965c59460fc093c6959216e44 (diff) | |
download | planr-f90a14d5d723c5d2b87f2eaa19f441dec33bb9b2.tar.xz planr-f90a14d5d723c5d2b87f2eaa19f441dec33bb9b2.zip |
Prototyped build pipeline
Diffstat (limited to 'runner.go')
-rw-r--r-- | runner.go | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,5 +1,9 @@ package planr +import ( + "fmt" +) + type Runner struct { adapters []Adapter } @@ -18,13 +22,8 @@ func (r Runner) adapterCfgs() []AdapterConfig { return cgs } -func (r Runner) collectUnits(root string) []TestCase { - tcs := make([]TestCase, 10) - - collectUnits(root, nil, r.adapterCfgs(), &tcs) - - return tcs -} +// [Initialization] -> [Generation] -> [Finalization] -> +// [Build] -> [Evaluation] -> [Clean] func (r Runner) cycle(tcs []TestCase) []TestResult { results := make([]TestResult, 0) @@ -36,14 +35,18 @@ func (r Runner) cycle(tcs []TestCase) []TestResult { for _, tc := range tcs { if tc.ContainsAdapter(aname) { + fmt.Printf("[R] Building %s\n", tc.Path) adapter.Build(tc) } } adapter.FinalizeBuild() + adapter.Make() + for _, tc := range tcs { if tc.ContainsAdapter(aname) { + fmt.Printf("[R] Evaluating %s\n", tc.Path) results = append(results, adapter.Evaluate(tc)) } } @@ -55,7 +58,7 @@ func (r Runner) cycle(tcs []TestCase) []TestResult { } func (r Runner) Run(root string) [] TestResult { - tcs := r.collectUnits(root) + tcs := collectUnits(root, r.adapterCfgs()) trs := r.cycle(tcs) |