backend/remote-state/inmem: enable optional logging in tests

This commit is contained in:
Martin Atkins 2018-10-02 14:56:29 -07:00
parent 78f1d1d1c0
commit 20727945ee
1 changed files with 20 additions and 0 deletions

View File

@ -1,14 +1,34 @@
package inmem
import (
"flag"
"io/ioutil"
"log"
"os"
"testing"
"github.com/hashicorp/hcl2/hcl"
"github.com/hashicorp/terraform/backend"
"github.com/hashicorp/terraform/helper/logging"
"github.com/hashicorp/terraform/state/remote"
statespkg "github.com/hashicorp/terraform/states"
)
func TestMain(m *testing.M) {
flag.Parse()
if testing.Verbose() {
// if we're verbose, use the logging requested by TF_LOG
logging.SetOutput()
} else {
// otherwise silence all logs
log.SetOutput(ioutil.Discard)
}
os.Exit(m.Run())
}
func TestBackend_impl(t *testing.T) {
var _ backend.Backend = new(Backend)
}