2015-04-18 16:46:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/go-check/check"
|
|
|
|
)
|
|
|
|
|
2015-04-22 18:20:32 +00:00
|
|
|
func Test(t *testing.T) {
|
|
|
|
check.TestingT(t)
|
|
|
|
}
|
2015-04-18 16:46:47 +00:00
|
|
|
|
|
|
|
type TimerSuite struct {
|
|
|
|
start time.Time
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *TimerSuite) SetUpTest(c *check.C) {
|
|
|
|
s.start = time.Now()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *TimerSuite) TearDownTest(c *check.C) {
|
|
|
|
fmt.Printf("%-60s%.2f\n", c.TestName(), time.Since(s.start).Seconds())
|
|
|
|
}
|
|
|
|
|
|
|
|
type DockerSuite struct {
|
|
|
|
TimerSuite
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerSuite) TearDownTest(c *check.C) {
|
|
|
|
deleteAllContainers()
|
2015-04-23 21:39:31 +00:00
|
|
|
deleteAllImages()
|
2015-04-18 16:46:47 +00:00
|
|
|
s.TimerSuite.TearDownTest(c)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ = check.Suite(&DockerSuite{})
|