summaryrefslogtreecommitdiff
path: root/integration/plugin/common/main_test.go
blob: 5bcbac2a8358ab987f39e5879ec2c8c12e0e0e82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package common // import "github.com/docker/docker/integration/plugin/common"

import (
	"fmt"
	"os"
	"testing"

	"github.com/docker/docker/testutil/environment"
)

var testEnv *environment.Execution

func TestMain(m *testing.M) {
	var err error
	testEnv, err = environment.New()
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
	testEnv.Print()
	os.Exit(m.Run())
}

func setupTest(t *testing.T) func() {
	environment.ProtectAll(t, testEnv)
	return func() { testEnv.Clean(t) }
}