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.

36 lines
980 B

8 years ago
8 years ago
8 years ago
  1. /*
  2. package tests contain integration tests and helper functions for testing
  3. the RPC interface
  4. In particular, it allows us to spin up a tendermint node in process, with
  5. a live RPC server, which we can use to verify our rpc calls. It provides
  6. all data structures, enabling us to do more complex tests (like node_test.go)
  7. that introspect the blocks themselves to validate signatures and the like.
  8. It currently only spins up one node, it would be interesting to expand it
  9. to multiple nodes to see the real effects of validating partially signed
  10. blocks.
  11. */
  12. package rpctest
  13. import (
  14. "os"
  15. "testing"
  16. "github.com/tendermint/abci/example/dummy"
  17. nm "github.com/tendermint/tendermint/node"
  18. )
  19. var node *nm.Node
  20. func TestMain(m *testing.M) {
  21. // start a tendermint node (and merkleeyes) in the background to test against
  22. app := dummy.NewDummyApplication()
  23. node = StartTendermint(app)
  24. code := m.Run()
  25. // and shut down proper at the end
  26. node.Stop()
  27. node.Wait()
  28. os.Exit(code)
  29. }