interfaces.go 945 B

123456789101112131415161718192021222324252627282930313233343536
  1. package suite
  2. import (
  3. "context"
  4. "testing"
  5. )
  6. // SetupAllSuite has a SetupSuite method, which will run before the
  7. // tests in the suite are run.
  8. type SetupAllSuite interface {
  9. SetUpSuite(context.Context, *testing.T)
  10. }
  11. // SetupTestSuite has a SetupTest method, which will run before each
  12. // test in the suite.
  13. type SetupTestSuite interface {
  14. SetUpTest(context.Context, *testing.T)
  15. }
  16. // TearDownAllSuite has a TearDownSuite method, which will run after
  17. // all the tests in the suite have been run.
  18. type TearDownAllSuite interface {
  19. TearDownSuite(context.Context, *testing.T)
  20. }
  21. // TearDownTestSuite has a TearDownTest method, which will run after
  22. // each test in the suite.
  23. type TearDownTestSuite interface {
  24. TearDownTest(context.Context, *testing.T)
  25. }
  26. // TimeoutTestSuite has a OnTimeout method, which will run after
  27. // a single test times out after a period specified by -timeout flag.
  28. type TimeoutTestSuite interface {
  29. OnTimeout()
  30. }