mirror of https://github.com/maxcnunes/gaper.git
parent
a2082c3041
commit
7f5268751f
|
@ -56,7 +56,7 @@ func (b *builder) Build() error {
|
||||||
|
|
||||||
output, err := command.CombinedOutput()
|
output, err := command.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("build failed with %v\n%s", err, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !command.ProcessState.Success() {
|
if !command.ProcessState.Success() {
|
||||||
|
|
|
@ -38,10 +38,15 @@ func TestBuilderFailureBuild(t *testing.T) {
|
||||||
t.Fatalf("couldn't get current working directory: %v", err)
|
t.Fatalf("couldn't get current working directory: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
absPathBuild := filepath.Join(wd, dir)
|
||||||
|
|
||||||
b := NewBuilder(dir, bin, wd, bArgs)
|
b := NewBuilder(dir, bin, wd, bArgs)
|
||||||
err = b.Build()
|
err = b.Build()
|
||||||
assert.NotNil(t, err, "build error")
|
assert.NotNil(t, err, "build error")
|
||||||
assert.Equal(t, err.Error(), "exit status 2")
|
assert.Equal(t, err.Error(), "build failed with exit status 2\n"+
|
||||||
|
"# _"+absPathBuild+"\n"+
|
||||||
|
"./main.go:4:6: func main must have no arguments and no return values\n"+
|
||||||
|
"./main.go:5:1: missing return at end of function\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuilderDefaultBinName(t *testing.T) {
|
func TestBuilderDefaultBinName(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue