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

@@ -89,7 +89,7 @@ func (i *Interface) Close() {
if i.config == nil {
return
}
libusb.release(i.config.dev.handle, uint8(i.Setting.Number))
i.config.dev.ctx.libusb.release(i.config.dev.handle, uint8(i.Setting.Number))
i.config.mu.Lock()
defer i.config.mu.Unlock()
delete(i.config.claimed, i.Setting.Number)
@@ -106,6 +106,7 @@ func (i *Interface) openEndpoint(epAddr EndpointAddress) (*endpoint, error) {
InterfaceSetting: i.Setting,
Desc: ep,
h: i.config.dev.handle,
ctx: i.config.dev.ctx,
}, nil
}