Merge pull request #40 from kylelemons/coverage

Add test coverage reporting based on Coveralls
This commit is contained in:
zagrodzki
2017-03-22 19:13:57 +01:00
committed by GitHub
4 changed files with 31 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -3,6 +3,7 @@ Introduction
[![Build Status][ciimg]][ci] [![Build Status][ciimg]][ci]
[![GoDoc][docimg]][doc] [![GoDoc][docimg]][doc]
[![Coverage Status](https://coveralls.io/repos/github/kylelemons/gousb/badge.svg?branch=coverage)](https://coveralls.io/github/kylelemons/gousb?branch=coverage)
The gousb package is an attempt at wrapping the libusb library into a Go-like binding. The gousb package is an attempt at wrapping the libusb library into a Go-like binding.

View File

@@ -16,12 +16,16 @@
package usb_test package usb_test
import ( import (
"os"
"testing" "testing"
. "github.com/kylelemons/gousb/usb" . "github.com/kylelemons/gousb/usb"
) )
func TestGetStringDescriptorAscii(t *testing.T) { func TestGetStringDescriptorAscii(t *testing.T) {
if os.Getenv("TRAVIS") == "true" {
t.Skip("test known to fail on Travis")
}
c := NewContext() c := NewContext()
defer c.Close() defer c.Close()
c.Debug(0) c.Debug(0)

View File

@@ -26,12 +26,18 @@ import (
) )
func TestNoop(t *testing.T) { func TestNoop(t *testing.T) {
if os.Getenv("TRAVIS") == "true" {
t.Skip("test known to fail on Travis")
}
c := NewContext() c := NewContext()
defer c.Close() defer c.Close()
c.Debug(0) c.Debug(0)
} }
func TestEnum(t *testing.T) { func TestEnum(t *testing.T) {
if os.Getenv("TRAVIS") == "true" {
t.Skip("test known to fail on Travis")
}
c := NewContext() c := NewContext()
defer c.Close() defer c.Close()
c.Debug(0) c.Debug(0)
@@ -83,6 +89,9 @@ func TestEnum(t *testing.T) {
} }
func TestOpenDeviceWithVidPid(t *testing.T) { func TestOpenDeviceWithVidPid(t *testing.T) {
if os.Getenv("TRAVIS") == "true" {
t.Skip("test known to fail on Travis")
}
c := NewContext() c := NewContext()
defer c.Close() defer c.Close()
c.Debug(0) c.Debug(0)
@@ -123,6 +132,9 @@ func TestOpenDeviceWithVidPid(t *testing.T) {
} }
func TestMultipleContexts(t *testing.T) { func TestMultipleContexts(t *testing.T) {
if os.Getenv("TRAVIS") == "true" {
t.Skip("test known to fail on Travis")
}
var buf bytes.Buffer var buf bytes.Buffer
log.SetOutput(&buf) log.SetOutput(&buf)
for i := 0; i < 2; i++ { for i := 0; i < 2; i++ {