@@ -26,6 +26,7 @@ import (
26
26
27
27
"github.com/containerd/nerdctl/mod/tigron/internal/assertive"
28
28
"github.com/containerd/nerdctl/mod/tigron/internal/formatter"
29
+ "github.com/containerd/nerdctl/mod/tigron/tig"
29
30
)
30
31
31
32
// Case describes an entire test-case, including data, setup and cleanup routines, command and
@@ -63,7 +64,7 @@ type Case struct {
63
64
64
65
// Private
65
66
helpers Helpers
66
- t * testing .T
67
+ t tig .T
67
68
parent * Case
68
69
}
69
70
@@ -151,7 +152,7 @@ func (test *Case) Run(t *testing.T) {
151
152
if test .Require != nil {
152
153
shouldRun , message := test .Require .Check (test .Data , test .helpers )
153
154
if ! shouldRun {
154
- test .t .Skipf ("test skipped as: %s" , message )
155
+ test .t .Skip ("test skipped as: " + message )
155
156
}
156
157
157
158
if test .Require .Setup != nil {
@@ -180,7 +181,7 @@ func (test *Case) Run(t *testing.T) {
180
181
181
182
// Set parallel unless asked not to
182
183
if ! test .NoParallel {
183
- test . t .Parallel ()
184
+ subT .Parallel ()
184
185
}
185
186
186
187
// Execute cleanups now
@@ -197,7 +198,7 @@ func (test *Case) Run(t *testing.T) {
197
198
}
198
199
199
200
// Register the cleanups, in reverse
200
- test . t .Cleanup (func () {
201
+ subT .Cleanup (func () {
201
202
test .t .Helper ()
202
203
test .t .Log (
203
204
"\n \n " + formatter .Table (
@@ -263,14 +264,14 @@ func (test *Case) Run(t *testing.T) {
263
264
264
265
if len (test .SubTests ) > 0 {
265
266
// Now go for the subtests
266
- test .t .Logf ( "\n %s️ %q: into subtests prep" , subinDecorator , test .t .Name ())
267
+ test .t .Log ( fmt . Sprintf ( "\n %s️ %q: into subtests prep" , subinDecorator , test .t .Name () ))
267
268
268
269
for _ , subTest := range test .SubTests {
269
270
subTest .parent = test
270
- subTest .Run (test . t )
271
+ subTest .Run (subT )
271
272
}
272
273
273
- test .t .Logf ( "\n %s️ %q: done with subtests prep" , suboutDecorator , test .t .Name ())
274
+ test .t .Log ( fmt . Sprintf ( "\n %s️ %q: done with subtests prep" , suboutDecorator , test .t .Name () ))
274
275
}
275
276
}
276
277
0 commit comments