diff --git a/suite/suite.go b/suite/suite.go index a7ceba731..e00a31158 100644 --- a/suite/suite.go +++ b/suite/suite.go @@ -16,6 +16,7 @@ import ( ) var matchMethod = flag.String("testify.m", "", "regular expression to select tests of the testify suite to run") +var repeatItem = flag.Uint("testify.c", 1, "used to repeat each test multiple times without rerunning Setup/TearDownSuite") // Suite is a basic testing suite with methods for storing and // retrieving the current *testing.T context. @@ -192,7 +193,10 @@ func Run(t *testing.T, suite TestingSuite) { method.Func.Call([]reflect.Value{reflect.ValueOf(suite)}) }, } - tests = append(tests, test) + + for i := uint(0); i < *repeatItem; i++ { + tests = append(tests, test) + } } if len(tests) == 0 {