diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-05 04:35:21 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-05 04:35:21 -0500 |
commit | d186e730a73b5b3009edbaab7617617d35dc2cff (patch) | |
tree | 56d0e472c5f3711984cb91584d5c458a04906fd6 /adapters | |
parent | 62e85f40923b3485ba60766052de7150acf039c5 (diff) | |
download | deb-planr-d186e730a73b5b3009edbaab7617617d35dc2cff.tar.xz deb-planr-d186e730a73b5b3009edbaab7617617d35dc2cff.zip |
Thread bash adapter
Diffstat (limited to 'adapters')
-rw-r--r-- | adapters/bash/adapter.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/adapters/bash/adapter.go b/adapters/bash/adapter.go index b98523e..65a6c80 100644 --- a/adapters/bash/adapter.go +++ b/adapters/bash/adapter.go @@ -83,9 +83,16 @@ func executeScriptedTest(testdir string, tc planr.TestCase) planr.TestResult { func (adapter Adapter) Evaluate(tcs []planr.TestCase) [] planr.TestResult { finalizeConfigs(tcs) - trs := make([]planr.TestResult, len(tcs)) - for i, tc := range tcs { - trs[i] = executeScriptedTest(adapter.dirs.Tests(), tc) + trs := make([]planr.TestResult, 0) + c := make(chan planr.TestResult, 0) + for i := range tcs { + go func(i int) { + c <- executeScriptedTest(adapter.dirs.Tests(), tcs[i]) + }(i) + } + + for range tcs { + trs = append(trs, <-c) } return trs |