github.com/jwhonce/docker@v0.6.7-0.20190327063223-da823cf3a5a3/integration/plugin/common/main_test.go (about)

     1  package common // import "github.com/docker/docker/integration/plugin/common"
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  	"testing"
     7  
     8  	"github.com/docker/docker/internal/test/environment"
     9  )
    10  
    11  var testEnv *environment.Execution
    12  
    13  func TestMain(m *testing.M) {
    14  	var err error
    15  	testEnv, err = environment.New()
    16  	if err != nil {
    17  		fmt.Println(err)
    18  		os.Exit(1)
    19  	}
    20  	testEnv.Print()
    21  	os.Exit(m.Run())
    22  }
    23  
    24  func setupTest(t *testing.T) func() {
    25  	environment.ProtectAll(t, testEnv)
    26  	return func() { testEnv.Clean(t) }
    27  }