mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 21:51:33 +00:00
Use suite for integration-cli
It prints test name and duration for each test. Also performs deleteAllContainers after each test. Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) { check.TestingT(t) }
|
||||
|
||||
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()
|
||||
s.TimerSuite.TearDownTest(c)
|
||||
}
|
||||
|
||||
var _ = check.Suite(&DockerSuite{})
|
||||
Reference in New Issue
Block a user