Browse code

testutil: remove unneeded namer, testname interfaces

Now that the gocheck framework is no longer used, we don't
have to define these interfaces.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/09/23 20:41:45
Showing 8 changed files
... ...
@@ -11,6 +11,7 @@ import (
11 11
 type testingT interface {
12 12
 	Fatal(args ...interface{})
13 13
 	Fatalf(string, ...interface{})
14
+	Name() string
14 15
 }
15 16
 
16 17
 // WithStdinContext sets the build context from the standard input with the specified reader
... ...
@@ -28,6 +28,7 @@ type testingT interface {
28 28
 	assert.TestingT
29 29
 	Fatal(args ...interface{})
30 30
 	Fatalf(string, ...interface{})
31
+	Name() string
31 32
 }
32 33
 
33 34
 // DockerCmd executes the specified docker command and expect a success
... ...
@@ -16,6 +16,7 @@ type testingT interface {
16 16
 	assert.TestingT
17 17
 	logT
18 18
 	Fatalf(string, ...interface{})
19
+	Name() string
19 20
 }
20 21
 
21 22
 type logT interface {
... ...
@@ -32,14 +32,8 @@ type testingT interface {
32 32
 	assert.TestingT
33 33
 	logT
34 34
 	Fatalf(string, ...interface{})
35
-}
36
-
37
-type namer interface {
38 35
 	Name() string
39 36
 }
40
-type testNamer interface {
41
-	TestName() string
42
-}
43 37
 
44 38
 type logT interface {
45 39
 	Logf(string, ...interface{})
... ...
@@ -157,13 +151,8 @@ func New(t testingT, ops ...Option) *Daemon {
157 157
 	if dest == "" {
158 158
 		dest = os.Getenv("DEST")
159 159
 	}
160
+	dest = filepath.Join(dest, t.Name())
160 161
 
161
-	switch v := t.(type) {
162
-	case namer:
163
-		dest = filepath.Join(dest, v.Name())
164
-	case testNamer:
165
-		dest = filepath.Join(dest, v.TestName())
166
-	}
167 162
 	assert.Check(t, dest != "", "Please set the DOCKER_INTEGRATION_DAEMON_DEST or the DEST environment variable")
168 163
 
169 164
 	t.Logf("Creating a new daemon at: %q", dest)
... ...
@@ -14,6 +14,7 @@ import (
14 14
 type testingT interface {
15 15
 	Fatal(args ...interface{})
16 16
 	Fatalf(string, ...interface{})
17
+	Name() string
17 18
 }
18 19
 
19 20
 // New creates a fake build context
... ...
@@ -21,6 +21,7 @@ type testingT interface {
21 21
 	skipT
22 22
 	Fatal(args ...interface{})
23 23
 	Fatalf(string, ...interface{})
24
+	Name() string
24 25
 }
25 26
 
26 27
 type logT interface {
... ...
@@ -30,6 +30,7 @@ type testingT interface {
30 30
 	skipT
31 31
 	Fatal(args ...interface{})
32 32
 	Fatalf(string, ...interface{})
33
+	Name() string
33 34
 }
34 35
 
35 36
 type logT interface {
... ...
@@ -28,6 +28,7 @@ type testingT interface {
28 28
 	logT
29 29
 	Fatal(...interface{})
30 30
 	Fatalf(string, ...interface{})
31
+	Name() string
31 32
 }
32 33
 
33 34
 type logT interface {