Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions parser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ func parse(
case tokenizer.ActionPackage:
pkgTracker.SetResult(evt.Package, "", ResultFail)
prevErroredPkg = evt.Package
case tokenizer.ActionBuildOutput:
pkgTracker.AddOutput(evt.Package, "", evt.Output)
case tokenizer.ActionStdout:
if evt.JSON {
// We have a JSON-encoded output, that makes things much easier.
Expand Down
1 change: 1 addition & 0 deletions testdata/issue-64.parser.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions testdata/issue-64.tokenizer.json

Large diffs are not rendered by default.

4,126 changes: 4,126 additions & 0 deletions testdata/issue-64.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tokenizer/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ const (
ActionFailFinal Action = "fail-final"
// ActionSkipFinal is a final SKIP line to indicate the entire package has failed.
ActionSkipFinal Action = "skip-final"
// ActionBuildOutput is an event when text was written to the standard output during the build.
ActionBuildOutput Action = "build-output"
)
14 changes: 13 additions & 1 deletion tokenizer/tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,18 @@ var stateMachine = []stateChange{
ActionStdout,
stateRun,
},
{
regexp.MustCompile(`^# (?P<Package>.*)\..*\n(?P<Output>(?s:.*))$`),
stateInit,
ActionBuildOutput,
stateInit,
},
{
regexp.MustCompile(`^# (?P<Package>.*)\..*\n(?P<Output>(?s:.*))$`),
stateBetweenTests,
ActionBuildOutput,
stateBetweenTests,
},
}

func decode(input io.Reader, output chan<- Event) {
Expand Down Expand Up @@ -475,7 +487,7 @@ func parseLine(currentState state, line []byte, output chan<- Event) state {
}
}
if len(line) != 0 {
panic(fmt.Errorf("failed to match line: %v", line))
panic(fmt.Errorf("failed to match line: %v", string(line)))
}
return currentState
}
Expand Down
Loading