Add XUnit compatible test output

This commit is contained in:
Jakob Borg 2016-01-10 00:31:55 +01:00
parent 1e52cc474f
commit 837fde70ae
3 changed files with 10 additions and 12 deletions

View File

@ -182,6 +182,7 @@ func setup() {
runPrint("go", "get", "-v", "github.com/tools/godep") runPrint("go", "get", "-v", "github.com/tools/godep")
runPrint("go", "get", "-v", "github.com/axw/gocov/gocov") runPrint("go", "get", "-v", "github.com/axw/gocov/gocov")
runPrint("go", "get", "-v", "github.com/AlekSi/gocov-xml") runPrint("go", "get", "-v", "github.com/AlekSi/gocov-xml")
runPrint("go", "get", "-v", "bitbucket.org/tebeka/go2xunit")
} }
func test(pkg string) { func test(pkg string) {

View File

@ -125,6 +125,15 @@ case "${1:-default}" in
fi fi
;; ;;
test-xunit)
ulimit -t 600 &>/dev/null || true
ulimit -d 512000 &>/dev/null || true
ulimit -m 512000 &>/dev/null || true
(GOPATH="$(pwd)/Godeps/_workspace:$GOPATH" go test -v -race ./lib/... ./cmd/... || true) > tests.out
go2xunit -output tests.xml -fail < tests.out
;;
docker-all) docker-all)
img=${DOCKERIMG:-syncthing/build:latest} img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \ docker run --rm -h syncthing-builder -u $(id -u) -t \

View File

@ -34,7 +34,6 @@ func TestMain(m *testing.M) {
} }
func TestHeaderFunctions(t *testing.T) { func TestHeaderFunctions(t *testing.T) {
t.Parallel()
f := func(ver, id, typ int) bool { f := func(ver, id, typ int) bool {
ver = int(uint(ver) % 16) ver = int(uint(ver) % 16)
id = int(uint(id) % 4096) id = int(uint(id) % 4096)
@ -49,7 +48,6 @@ func TestHeaderFunctions(t *testing.T) {
} }
func TestHeaderLayout(t *testing.T) { func TestHeaderLayout(t *testing.T) {
t.Parallel()
var e, a uint32 var e, a uint32
// Version are the first four bits // Version are the first four bits
@ -75,7 +73,6 @@ func TestHeaderLayout(t *testing.T) {
} }
func TestPing(t *testing.T) { func TestPing(t *testing.T) {
t.Parallel()
ar, aw := io.Pipe() ar, aw := io.Pipe()
br, bw := io.Pipe() br, bw := io.Pipe()
@ -95,7 +92,6 @@ func TestPing(t *testing.T) {
} }
func TestVersionErr(t *testing.T) { func TestVersionErr(t *testing.T) {
t.Parallel()
m0 := newTestModel() m0 := newTestModel()
m1 := newTestModel() m1 := newTestModel()
@ -123,7 +119,6 @@ func TestVersionErr(t *testing.T) {
} }
func TestTypeErr(t *testing.T) { func TestTypeErr(t *testing.T) {
t.Parallel()
m0 := newTestModel() m0 := newTestModel()
m1 := newTestModel() m1 := newTestModel()
@ -151,7 +146,6 @@ func TestTypeErr(t *testing.T) {
} }
func TestClose(t *testing.T) { func TestClose(t *testing.T) {
t.Parallel()
m0 := newTestModel() m0 := newTestModel()
m1 := newTestModel() m1 := newTestModel()
@ -187,7 +181,6 @@ func TestClose(t *testing.T) {
} }
func TestElementSizeExceededNested(t *testing.T) { func TestElementSizeExceededNested(t *testing.T) {
t.Parallel()
m := ClusterConfigMessage{ m := ClusterConfigMessage{
ClientName: "longstringlongstringlongstringinglongstringlongstringlonlongstringlongstringlon", ClientName: "longstringlongstringlongstringinglongstringlongstringlonlongstringlongstringlon",
} }
@ -198,7 +191,6 @@ func TestElementSizeExceededNested(t *testing.T) {
} }
func TestMarshalIndexMessage(t *testing.T) { func TestMarshalIndexMessage(t *testing.T) {
t.Parallel()
f := func(m1 IndexMessage) bool { f := func(m1 IndexMessage) bool {
for i, f := range m1.Files { for i, f := range m1.Files {
m1.Files[i].CachedSize = 0 m1.Files[i].CachedSize = 0
@ -219,7 +211,6 @@ func TestMarshalIndexMessage(t *testing.T) {
} }
func TestMarshalRequestMessage(t *testing.T) { func TestMarshalRequestMessage(t *testing.T) {
t.Parallel()
f := func(m1 RequestMessage) bool { f := func(m1 RequestMessage) bool {
return testMarshal(t, "request", &m1, &RequestMessage{}) return testMarshal(t, "request", &m1, &RequestMessage{})
} }
@ -230,7 +221,6 @@ func TestMarshalRequestMessage(t *testing.T) {
} }
func TestMarshalResponseMessage(t *testing.T) { func TestMarshalResponseMessage(t *testing.T) {
t.Parallel()
f := func(m1 ResponseMessage) bool { f := func(m1 ResponseMessage) bool {
if len(m1.Data) == 0 { if len(m1.Data) == 0 {
m1.Data = nil m1.Data = nil
@ -244,7 +234,6 @@ func TestMarshalResponseMessage(t *testing.T) {
} }
func TestMarshalClusterConfigMessage(t *testing.T) { func TestMarshalClusterConfigMessage(t *testing.T) {
t.Parallel()
f := func(m1 ClusterConfigMessage) bool { f := func(m1 ClusterConfigMessage) bool {
return testMarshal(t, "clusterconfig", &m1, &ClusterConfigMessage{}) return testMarshal(t, "clusterconfig", &m1, &ClusterConfigMessage{})
} }
@ -255,7 +244,6 @@ func TestMarshalClusterConfigMessage(t *testing.T) {
} }
func TestMarshalCloseMessage(t *testing.T) { func TestMarshalCloseMessage(t *testing.T) {
t.Parallel()
f := func(m1 CloseMessage) bool { f := func(m1 CloseMessage) bool {
return testMarshal(t, "close", &m1, &CloseMessage{}) return testMarshal(t, "close", &m1, &CloseMessage{})
} }