github.com/hs0210/hashicorp-terraform@v0.11.12-beta1/backend/local/local_test.go (about)

     1  package local
     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  	os.Exit(m.Run())
    25  }