1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

removed invalid builds and improved tests

This commit is contained in:
Carlos Alexandro Becker 2017-04-21 12:54:45 -03:00
parent ab87672b60
commit ab96fcbade
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 56 additions and 5 deletions

View File

@ -5,8 +5,8 @@ var valids = []string{
"androidarm",
"darwin386",
"darwinamd64",
"darwinarm",
"darwinarm64",
// "darwinarm", - requires admin rights and other ios stuff
// "darwinarm64", - requires admin rights and other ios stuff
"dragonflyamd64",
"freebsd386",
"freebsdamd64",

View File

@ -1,13 +1,64 @@
package build
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestValid(t *testing.T) {
assert.True(t, valid("windows", "386"))
assert.True(t, valid("linux", "386"))
assert.False(t, valid("windows", "arm"))
var platforms = []struct {
goos, goarch string
}{
{"android", "arm"},
{"darwin", "386"},
{"darwin", "amd64"},
{"dragonfly", "amd64"},
{"freebsd", "386"},
{"freebsd", "amd64"},
{"freebsd", "arm"},
{"linux", "386"},
{"linux", "amd64"},
{"linux", "arm"},
{"linux", "arm64"},
{"linux", "ppc64"},
{"linux", "ppc64le"},
{"linux", "mips"},
{"linux", "mipsle"},
{"linux", "mips64"},
{"linux", "mips64le"},
{"netbsd", "386"},
{"netbsd", "amd64"},
{"netbsd", "arm"},
{"openbsd", "386"},
{"openbsd", "amd64"},
{"openbsd", "arm"},
{"plan9", "386"},
{"plan9", "amd64"},
{"solaris", "amd64"},
{"windows", "386"},
{"windows", "amd64"},
}
for _, p := range platforms {
t.Run(fmt.Sprintf("%v %v is valid", p.goos, p.goarch), func(t *testing.T) {
assert.True(t, valid(p.goos, p.goarch))
})
}
}
func TestInvalid(t *testing.T) {
var platforms = []struct {
goos, goarch string
}{
{"darwin", "arm"},
{"darwin", "arm64"},
{"windows", "arm"},
{"windows", "arm64"},
}
for _, p := range platforms {
t.Run(fmt.Sprintf("%v %v is invalid", p.goos, p.goarch), func(t *testing.T) {
assert.False(t, valid(p.goos, p.goarch))
})
}
}