diff options
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/hakurei/testsuite/sandbox/main.go | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/cmd/hakurei/testsuite/sandbox/main.go b/cmd/hakurei/testsuite/sandbox/main.go index bd36d1b8..2b2cbed2 100644 --- a/cmd/hakurei/testsuite/sandbox/main.go +++ b/cmd/hakurei/testsuite/sandbox/main.go @@ -273,7 +273,7 @@ func main() { defer cancel() pid, done := mustStart(c, testsuite.NewSerial(), 0, &cred) - testsuite.MustCheckFilter(pid, testdata.SumPD) + testsuite.MustCheckFilter("pd", pid, testdata.SumPD) if err := testsuite.FilterTerminated(<-done); err != nil { log.Fatal(err) } @@ -340,9 +340,13 @@ func main() { for name, tc := range testdata.All() { wg.Go(func() { - _, pid := testsuite.MustStartHakurei( - ctx, &wg, &cred, dbusEnv, + c, cancel := context.WithCancel(ctx) + + _, pid, err := testsuite.StartHakurei( + c, &wg, &cred, dbusEnv, nil, func(err error, output string) { + defer cancel() + log.Printf("completed test case %s", name) if err != nil { log.Fatalf("test case %s: %v\n%s", name, err, output) @@ -350,10 +354,17 @@ func main() { }, true, true, false, false, &tc.Hakurei, ) - testsuite.MustCheckFilter( - pid, - tc.Sum, - ) + if err != nil { + log.Printf( + "cannot start test case %s: %v", + name, + err, + ) + cancel() + // onDone eventually terminates the test suite + } else { + testsuite.MustCheckFilter(name, pid, tc.Sum) + } }) } |
