/
plugin.go
53 lines (45 loc) · 943 Bytes
/
plugin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package sweet
import (
"time"
)
type Plugin interface {
Name() string
Options() *PluginOptions
SetOption(name, value string)
Starting()
SuiteStarting(suite string)
TestStarting(testName *TestName)
TestPassed(testName *TestName, stats *TestPassedStats)
TestFailed(testName *TestName, stats *TestFailedStats)
TestSkipped(testName *TestName, stats *TestSkippedStats)
SuiteFinished(suite string, stats *SuiteFinishedStats)
Finished()
}
type PluginOptions struct {
Prefix string
Options map[string]*PluginOption
}
type PluginOption struct {
Help string
Default string
}
type TestPassedStats struct {
Time time.Duration
}
type TestFailedStats struct {
Name *TestName
Time time.Duration
Message string
Frames []*TestFailedFrame
}
type TestFailedFrame struct {
File string
Line int
Hidden bool
}
type TestSkippedStats struct {
Time time.Duration
}
type SuiteFinishedStats struct {
Time time.Duration
}