From d6173077f12c029d8d4c70f500a3602af88b4337 Mon Sep 17 00:00:00 2001 From: Mark Ryan Date: Mon, 3 Dec 2018 15:53:16 +0100 Subject: [PATCH] Run tests for the s390x build It turns out it is possible to run the unit tests for the s390x build on travis by renaming the s390x specific files, so that their inclusion in the build is determined only by tags and not by filename, and by introducing a new tag s390x_test that we can use to force their inclusion into a build by using this tag. The .travis file is then updated to include the line go test --tags s390x_test ./... This creates a build on travis that includes the s390x specific files and runs the unit tests. Signed-off-by: Mark Ryan --- .travis.yml | 1 + qemu/qemu_arch_base.go | 2 +- qemu/qemu_arch_base_test.go | 2 +- qemu/{qemu_s390x.go => qemus390x.go} | 2 +- qemu/{qemu_s390x_test.go => qemus390x_test.go} | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) rename qemu/{qemu_s390x.go => qemus390x.go} (99%) rename qemu/{qemu_s390x_test.go => qemus390x_test.go} (99%) diff --git a/.travis.yml b/.travis.yml index 1cfe2ef036..b8eaf3eb6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,3 +21,4 @@ script: - $GOPATH/bin/goveralls -v -service=travis-ci - gometalinter --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=errcheck --enable=deadcode --enable=staticcheck -enable=gas ./... - GOARCH=s390x go install ./... + - go test --tags s390x_test ./... diff --git a/qemu/qemu_arch_base.go b/qemu/qemu_arch_base.go index 5e293d1d62..521741fa6a 100644 --- a/qemu/qemu_arch_base.go +++ b/qemu/qemu_arch_base.go @@ -1,4 +1,4 @@ -// +build !s390x +// +build !s390x,!s390x_test /* // Copyright contributors to the Virtual Machine Manager for Go project diff --git a/qemu/qemu_arch_base_test.go b/qemu/qemu_arch_base_test.go index 64a8415b49..93eac3ee56 100644 --- a/qemu/qemu_arch_base_test.go +++ b/qemu/qemu_arch_base_test.go @@ -1,4 +1,4 @@ -// +build !s390x +// +build !s390x,!s390x_test /* // Copyright contributors to the Virtual Machine Manager for Go project diff --git a/qemu/qemu_s390x.go b/qemu/qemus390x.go similarity index 99% rename from qemu/qemu_s390x.go rename to qemu/qemus390x.go index d8395837fc..7c45c3edd9 100644 --- a/qemu/qemu_s390x.go +++ b/qemu/qemus390x.go @@ -1,4 +1,4 @@ -// +build s390x +// +build s390x s390x_test /* // Copyright contributors to the Virtual Machine Manager for Go project diff --git a/qemu/qemu_s390x_test.go b/qemu/qemus390x_test.go similarity index 99% rename from qemu/qemu_s390x_test.go rename to qemu/qemus390x_test.go index b76af3ced5..1aac28434e 100644 --- a/qemu/qemu_s390x_test.go +++ b/qemu/qemus390x_test.go @@ -1,4 +1,4 @@ -// +build s390x +// +build s390x s390x_test /* // Copyright contributors to the Virtual Machine Manager for Go project