github.com/svenhamers/terraform@v0.11.12-beta1/backend/remote/remote_test.go (about)

     1  package remote
     2  
     3  import (
     4  	"flag"
     5  	"io/ioutil"
     6  	"log"
     7  	"os"
     8  	"testing"
     9  
    10  	"github.com/hashicorp/terraform/helper/logging"
    11  )
    12  
    13  func TestMain(m *testing.M) {
    14  	flag.Parse()
    15  
    16  	if testing.Verbose() {
    17  		// if we're verbose, use the logging requested by TF_LOG
    18  		logging.SetOutput()
    19  	} else {
    20  		// otherwise silence all logs
    21  		log.SetOutput(ioutil.Discard)
    22  	}
    23  
    24  	// Make sure TF_FORCE_LOCAL_BACKEND is unset
    25  	os.Unsetenv("TF_FORCE_LOCAL_BACKEND")
    26  
    27  	os.Exit(m.Run())
    28  }