mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-04-05 05:00:15 -05:00
gtr: Add support for pause/continue tests
This commit is contained in:
parent
c845dfac27
commit
f7ae0905a2
@ -58,6 +58,14 @@ func (b *ReportBuilder) CreateTest(name string) {
|
|||||||
b.tests[b.newId()] = Test{Name: name}
|
b.tests[b.newId()] = Test{Name: name}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *ReportBuilder) PauseTest(name string) {
|
||||||
|
b.lastId = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (b *ReportBuilder) ContinueTest(name string) {
|
||||||
|
b.lastId = b.findTest(name)
|
||||||
|
}
|
||||||
|
|
||||||
func (b *ReportBuilder) EndTest(name, result string, duration time.Duration) {
|
func (b *ReportBuilder) EndTest(name, result string, duration time.Duration) {
|
||||||
id := b.findTest(name)
|
id := b.findTest(name)
|
||||||
b.lastId = id
|
b.lastId = id
|
||||||
|
@ -76,6 +76,10 @@ func FromEvents(events []Event, packageName string) Report {
|
|||||||
switch ev.Type {
|
switch ev.Type {
|
||||||
case "run_test":
|
case "run_test":
|
||||||
report.CreateTest(ev.Name)
|
report.CreateTest(ev.Name)
|
||||||
|
case "pause_test":
|
||||||
|
report.PauseTest(ev.Name)
|
||||||
|
case "cont_test":
|
||||||
|
report.ContinueTest(ev.Name)
|
||||||
case "end_test":
|
case "end_test":
|
||||||
report.EndTest(ev.Name, ev.Result, ev.Duration)
|
report.EndTest(ev.Name, ev.Result, ev.Duration)
|
||||||
case "benchmark":
|
case "benchmark":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user