gtr: Add support for pause/continue tests

This commit is contained in:
Joël Stemmer 2019-10-07 00:24:01 +01:00
parent c845dfac27
commit f7ae0905a2
2 changed files with 12 additions and 0 deletions

View File

@ -58,6 +58,14 @@ func (b *ReportBuilder) CreateTest(name string) {
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) {
id := b.findTest(name)
b.lastId = id

View File

@ -76,6 +76,10 @@ func FromEvents(events []Event, packageName string) Report {
switch ev.Type {
case "run_test":
report.CreateTest(ev.Name)
case "pause_test":
report.PauseTest(ev.Name)
case "cont_test":
report.ContinueTest(ev.Name)
case "end_test":
report.EndTest(ev.Name, ev.Result, ev.Duration)
case "benchmark":