Parallelize tests (#17)

* Store a reference to libusb implementation in the context, transfers
and some more places. Remove the global libusb variable.

* Parallelize tests.

* Fix the link in README.
This commit is contained in:
zagrodzki
2017-09-04 16:55:47 +02:00
committed by GitHub
parent f9aba6fab5
commit c113a5e0de
15 changed files with 159 additions and 120 deletions

View File

@@ -77,6 +77,8 @@ type endpoint struct {
Desc EndpointDesc
Timeout time.Duration
ctx *Context
}
// String returns a human-readable description of the endpoint.
@@ -89,7 +91,7 @@ func (e *endpoint) transfer(buf []byte) (int, error) {
return 0, nil
}
t, err := newUSBTransfer(e.h, &e.Desc, len(buf), e.Timeout)
t, err := newUSBTransfer(e.ctx, e.h, &e.Desc, len(buf), e.Timeout)
if err != nil {
return 0, err
}