You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
660 B

package client_test
import (
"io/ioutil"
"os"
"testing"
"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
dir, err := ioutil.TempDir("/tmp", "rpc-client-test")
if err != nil {
panic(err)
}
app := kvstore.NewPersistentKVStoreApplication(dir)
node = rpctest.StartTendermint(app)
code := m.Run()
// and shut down proper at the end
rpctest.StopTendermint(node)
app.Close()
_ = os.RemoveAll(dir)
os.Exit(code)
}