-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
321 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,44 @@ | ||
package suite | ||
|
||
import "testing" | ||
|
||
// TestingSuite can store and return the current *testing.T context | ||
// generated by 'go test'. | ||
type TestingSuite interface { | ||
T() *testing.T | ||
setT(*testing.T) | ||
clearT() | ||
} | ||
|
||
// CopySuite indicates a copyable struct, deepcopy vs shallow is | ||
// implementation detail of the application. | ||
type CopySuite interface { | ||
// Copy creates a copy of the calling suite object. The returned | ||
// object must be the same concrete type as caller | ||
Copy() TestingSuite | ||
} | ||
|
||
// SetupAllSuite has a SetupSuite method, which will run before the | ||
// tests in the suite are run. | ||
type SetupAllSuite interface { | ||
SetupSuite() | ||
SetupSuite(t *T) | ||
} | ||
|
||
// SetupTestSuite has a SetupTest method, which will run before each | ||
// test in the suite. | ||
type SetupTestSuite interface { | ||
SetupTest() | ||
SetupTest(t *T) | ||
} | ||
|
||
// TearDownAllSuite has a TearDownSuite method, which will run after | ||
// all the tests in the suite have been run. | ||
type TearDownAllSuite interface { | ||
TearDownSuite() | ||
TearDownSuite(t *T) | ||
} | ||
|
||
// TearDownTestSuite has a TearDownTest method, which will run after | ||
// each test in the suite. | ||
type TearDownTestSuite interface { | ||
TearDownTest() | ||
TearDownTest(t *T) | ||
} | ||
|
||
// BeforeTest has a function to be executed right before the test | ||
// starts and receives the suite and test names as input | ||
type BeforeTest interface { | ||
BeforeTest(suiteName, testName string) | ||
BeforeTest(t *T, suiteName, testName string) | ||
} | ||
|
||
// AfterTest has a function to be executed right after the test | ||
// finishes and receives the suite and test names as input | ||
type AfterTest interface { | ||
AfterTest(suiteName, testName string) | ||
AfterTest(t *T, suiteName, testName string) | ||
} | ||
|
||
// WithStats implements HandleStats, a function that will be executed | ||
// when a test suite is finished. The stats contain information about | ||
// the execution of that suite and its tests. | ||
type WithStats interface { | ||
HandleStats(suiteName string, stats *SuiteInformation) | ||
HandleStats(t *T, suiteName string, stats *SuiteInformation) | ||
} |
Oops, something went wrong.