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.

31 lines
647 B

  1. package client_test
  2. import (
  3. "io/ioutil"
  4. "os"
  5. "testing"
  6. "github.com/tendermint/tendermint/abci/example/kvstore"
  7. nm "github.com/tendermint/tendermint/node"
  8. rpctest "github.com/tendermint/tendermint/rpc/test"
  9. )
  10. var node *nm.Node
  11. func TestMain(m *testing.M) {
  12. // start a tendermint node (and kvstore) in the background to test against
  13. dir, err := ioutil.TempDir("/tmp", "rpc-client-test")
  14. if err != nil {
  15. panic(err)
  16. }
  17. app := kvstore.NewPersistentKVStoreApplication(dir)
  18. node = rpctest.StartTendermint(app)
  19. code := m.Run()
  20. // and shut down proper at the end
  21. rpctest.StopTendermint(node)
  22. _ = os.RemoveAll(dir)
  23. os.Exit(code)
  24. }