mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
dovecot: Include cli-based tests in the coverage tests
Many areas of the dovecot library are tested via chamuyero scripts, but these were not being included in the coverage report. This patch extends the dovecot-auth-cli tests so that they are now coverage-aware.
This commit is contained in:
33
cmd/dovecot-auth-cli/coverage_test.go
Normal file
33
cmd/dovecot-auth-cli/coverage_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// 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.
|
||||
//
|
||||
// +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
|
||||
}
|
||||
Reference in New Issue
Block a user