1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00
Files
go-chasquid-smtp/cmd/dovecot-auth-cli/coverage_test.go
Alberto Bertogli 5bb17c7066 Update build tag constraints
This patch updates all build tag constraints to add the new format,
alongside the old one, to maintain backwards compatibility.

This was done by using `go fmt`.

See https://go.dev/doc/go1.17#gofmt and
https://golang.org/design/draft-gobuild for more details.
2022-08-08 17:52:34 +01:00

35 lines
549 B
Go

// This package is tested externally (see test.sh).
// However, we need this to do coverage tests.
//
// See coverage_test.go for the details, this is the same horrible hack.
//
//go:build coveragebin
// +build coveragebin
package main
import (
"os"
"os/signal"
"syscall"
"testing"
)
func TestRunMain(t *testing.T) {
done := make(chan bool)
signals := make(chan os.Signal, 1)
go func() {
<-signals
done <- true
}()
signal.Notify(signals, os.Interrupt, os.Kill, syscall.SIGTERM)
go func() {
main()
done <- true
}()
<-done
}