diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-12 18:14:01 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-12 18:14:01 +0900 |
| commit | 11e395a1a7453b93c695e849bd93d8c2c0af6aef (patch) | |
| tree | 8f874f9ce4371ae59ac7738bdfa2f028efc00ff6 /internal | |
| parent | 39726881f528afbbf8f8b49d6f0921d1f330acd8 (diff) | |
cmd/hakurei/testsuite: extra exercise parameters
This also removes the interval and fixes the mustStart search criteria.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/testsuite/testsuite.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/testsuite/testsuite.go b/internal/testsuite/testsuite.go index 6e48eca1..2c82e1e9 100644 --- a/internal/testsuite/testsuite.go +++ b/internal/testsuite/testsuite.go @@ -17,10 +17,17 @@ import ( "strconv" "strings" "sync" + "sync/atomic" "syscall" "time" ) +// serial is the next value returned by [NewSerial]. +var serial atomic.Uint64 + +// NewSerial returns a serial number. +func NewSerial() uint64 { defer serial.Add(1); return serial.Load() } + // ReceiveSignals blocks until a termination signal arrives, and terminates. func ReceiveSignals() { s := make(chan os.Signal, 3) @@ -116,7 +123,7 @@ func MustStart(cmd *exec.Cmd) (done <-chan error) { if err := cmd.Start(); err != nil { log.Fatal(err) } - d := make(chan error) + d := make(chan error, 1) go func() { d <- cmd.Wait() }() return d } |
