mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
37 lines
782 B
Go
37 lines
782 B
Go
package build
|
|
|
|
import (
|
|
"runtime"
|
|
"testing"
|
|
|
|
"github.com/goreleaser/goreleaser/config"
|
|
"github.com/goreleaser/goreleaser/context"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestDescription(t *testing.T) {
|
|
assert.NotEmpty(t, Pipe{}.Description())
|
|
}
|
|
|
|
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))
|
|
}
|