1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/pipeline/build/build_test.go
Carlos Alexandro Becker 4af2cb00ea
ldflags template
2017-03-25 20:24:38 -03:00

33 lines
700 B
Go

package build
import (
"runtime"
"testing"
"github.com/goreleaser/goreleaser/config"
"github.com/goreleaser/goreleaser/context"
"github.com/stretchr/testify/assert"
)
func TestRun(t *testing.T) {
assert.NoError(t, run(runtime.GOOS, runtime.GOARCH, []string{"go", "list", "./..."}))
}
func TestRunInvalidCommand(t *testing.T) {
assert.Error(t, run(runtime.GOOS, runtime.GOARCH, []string{"gggggo", "nope"}))
}
func TestBuild(t *testing.T) {
assert := assert.New(t)
var config = config.Project{
Build: config.Build{
Binary: "testing",
Flags: "-n",
},
}
var ctx = &context.Context{
Config: config,
}
assert.NoError(build("build_test", runtime.GOOS, runtime.GOARCH, ctx))
}