mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
33 lines
418 B
Go
33 lines
418 B
Go
package intel
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/safing/portmaster/core"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
// setup
|
|
tmpDir, err := core.InitForTesting()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
// setup package
|
|
err = prep()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
loadResolvers()
|
|
|
|
// run tests
|
|
rv := m.Run()
|
|
|
|
// teardown
|
|
core.StopTesting()
|
|
_ = os.RemoveAll(tmpDir)
|
|
|
|
// exit with test run return value
|
|
os.Exit(rv)
|
|
}
|