mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-25 14:35:48 +03:00
20 lines
387 B
Go
20 lines
387 B
Go
|
// Package testutil contains utilities for testing.
|
||
|
package testutil
|
||
|
|
||
|
import (
|
||
|
"io/ioutil"
|
||
|
"os"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/AdguardTeam/golibs/log"
|
||
|
)
|
||
|
|
||
|
// DiscardLogOutput runs tests with discarded logger output.
|
||
|
func DiscardLogOutput(m *testing.M) {
|
||
|
// TODO(e.burkov): Refactor code and tests to not use the global mutable
|
||
|
// logger.
|
||
|
log.SetOutput(ioutil.Discard)
|
||
|
|
||
|
os.Exit(m.Run())
|
||
|
}
|