check_test.go 549 B

12345678910111213141516171819202122232425262728293031323334
  1. package main
  2. import (
  3. "fmt"
  4. "testing"
  5. "time"
  6. "github.com/go-check/check"
  7. )
  8. func Test(t *testing.T) { check.TestingT(t) }
  9. type TimerSuite struct {
  10. start time.Time
  11. }
  12. func (s *TimerSuite) SetUpTest(c *check.C) {
  13. s.start = time.Now()
  14. }
  15. func (s *TimerSuite) TearDownTest(c *check.C) {
  16. fmt.Printf("%-60s%.2f\n", c.TestName(), time.Since(s.start).Seconds())
  17. }
  18. type DockerSuite struct {
  19. TimerSuite
  20. }
  21. func (s *DockerSuite) TearDownTest(c *check.C) {
  22. deleteAllContainers()
  23. s.TimerSuite.TearDownTest(c)
  24. }
  25. var _ = check.Suite(&DockerSuite{})