From 6116f8879faff1a8145f55d9f537c33f39931678 Mon Sep 17 00:00:00 2001 From: Josh MacDonald Date: Tue, 3 Nov 2015 23:34:00 -0800 Subject: Test exposed XD3_TOOFARBACK in default branch (despite not yet WAI), caused by inconsistent frontier_pos handling with source FIFO --- xdelta3/go/src/xdelta/test.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'xdelta3/go/src/xdelta') diff --git a/xdelta3/go/src/xdelta/test.go b/xdelta3/go/src/xdelta/test.go index 9eb47f6..e853554 100644 --- a/xdelta3/go/src/xdelta/test.go +++ b/xdelta3/go/src/xdelta/test.go @@ -31,6 +31,8 @@ type Runner struct { type TestGroup struct { sync.WaitGroup + sync.Mutex + errs []error } type Run struct { @@ -42,10 +44,17 @@ type Run struct { Stderr io.ReadCloser } + func (t *TestGroup) Panic(err error) { + t.Lock() + t.errs = append(t.errs, err) + t.Unlock() t.Done() // For the caller t.Wait() - panic(err) + for _, e := range t.errs { + fmt.Println(e) + } + panic(fmt.Sprintf("%d errors", len(t.errs))) } func NewTestGroup() *TestGroup { @@ -185,9 +194,8 @@ func (r *Runner) Exec(p *Program, srcfifo bool, flags []string) (*Run, error) { run.Cmd.Path = p.Path run.Cmd.Args = append(args, flags...) run.Cmd.Dir = r.Testdir - run.Cmd.Start() - return run, nil + return run, run.Cmd.Start() } func writeFifo(srcfile string, read io.Reader) error { -- cgit v1.2.3