tendermint/rpc/client/main_test.go

27 lines
544 B
Go
Raw Normal View History

package client_test
import (
"os"
"testing"
2018-06-22 06:59:02 +02:00
"github.com/tendermint/tendermint/abci/example/kvstore"
nm "github.com/tendermint/tendermint/node"
rpctest "github.com/tendermint/tendermint/rpc/test"
)
var node *nm.Node
func TestMain(m *testing.M) {
// start a tendermint node (and kvstore) in the background to test against
var cleanup func()
app := kvstore.NewKVStoreApplication()
node, cleanup = rpctest.StartTendermint(app)
code := m.Run()
// and shut down proper at the end
node.Stop()
node.Wait()
cleanup()
os.Exit(code)
}