diff options
author | Josh MacDonald <josh.macdonald@gmail.com> | 2015-11-03 23:34:00 -0800 |
---|---|---|
committer | Josh MacDonald <josh.macdonald@gmail.com> | 2015-11-03 23:34:00 -0800 |
commit | 6116f8879faff1a8145f55d9f537c33f39931678 (patch) | |
tree | 3f24cd35c4b238bc77cd4bfa0e3f33cccca6677a /xdelta3/go/src/xdelta | |
parent | 65e39a369ce7befe18cfcb350e4d3cc391cc09f2 (diff) |
Test exposed XD3_TOOFARBACK in default branch (despite not yet WAI), caused by inconsistent frontier_pos handling with source FIFO
Diffstat (limited to 'xdelta3/go/src/xdelta')
-rw-r--r-- | xdelta3/go/src/xdelta/test.go | 14 |
1 files changed, 11 insertions, 3 deletions
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 { | |||
31 | 31 | ||
32 | type TestGroup struct { | 32 | type TestGroup struct { |
33 | sync.WaitGroup | 33 | sync.WaitGroup |
34 | sync.Mutex | ||
35 | errs []error | ||
34 | } | 36 | } |
35 | 37 | ||
36 | type Run struct { | 38 | type Run struct { |
@@ -42,10 +44,17 @@ type Run struct { | |||
42 | Stderr io.ReadCloser | 44 | Stderr io.ReadCloser |
43 | } | 45 | } |
44 | 46 | ||
47 | |||
45 | func (t *TestGroup) Panic(err error) { | 48 | func (t *TestGroup) Panic(err error) { |
49 | t.Lock() | ||
50 | t.errs = append(t.errs, err) | ||
51 | t.Unlock() | ||
46 | t.Done() // For the caller | 52 | t.Done() // For the caller |
47 | t.Wait() | 53 | t.Wait() |
48 | panic(err) | 54 | for _, e := range t.errs { |
55 | fmt.Println(e) | ||
56 | } | ||
57 | panic(fmt.Sprintf("%d errors", len(t.errs))) | ||
49 | } | 58 | } |
50 | 59 | ||
51 | func NewTestGroup() *TestGroup { | 60 | func NewTestGroup() *TestGroup { |
@@ -185,9 +194,8 @@ func (r *Runner) Exec(p *Program, srcfifo bool, flags []string) (*Run, error) { | |||
185 | run.Cmd.Path = p.Path | 194 | run.Cmd.Path = p.Path |
186 | run.Cmd.Args = append(args, flags...) | 195 | run.Cmd.Args = append(args, flags...) |
187 | run.Cmd.Dir = r.Testdir | 196 | run.Cmd.Dir = r.Testdir |
188 | run.Cmd.Start() | ||
189 | 197 | ||
190 | return run, nil | 198 | return run, run.Cmd.Start() |
191 | } | 199 | } |
192 | 200 | ||
193 | func writeFifo(srcfile string, read io.Reader) error { | 201 | func writeFifo(srcfile string, read io.Reader) error { |