generated from bep/golibtemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_test.go
44 lines (38 loc) · 1.04 KB
/
build_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package buildpkg
import (
"log"
"os"
"path/filepath"
"testing"
qt "github.com/frankban/quicktest"
)
func TestBuild(t *testing.T) {
if os.Getenv("CI") != "" {
t.Skip("Skipping test on CI")
}
c := qt.New(t)
wd, err := os.Getwd()
c.Assert(err, qt.IsNil)
testData := filepath.Join(wd, "testdata")
opts := Options{
Infof: func(format string, args ...interface{}) {
log.Printf(format, args...)
},
Dir: testData,
SigningIdentity: "ZYSJUFSYL4",
StagingDirectory: filepath.Join(testData, "staging"),
Identifier: "is.bep.helloworld",
Version: "0.0.13",
InstallLocation: "/usr/local/bin",
PackageOutputFilename: filepath.Join(testData, "helloworld.pkg"),
SkipCodeSigning: false,
SkipNotarization: false,
SkipInstallerSigning: false,
//ScriptsDirectory: "./testdata/scripts",
}
builder, err := New(opts)
c.Assert(err, qt.IsNil)
c.Assert(builder.runCommand("./prepare.sh", builder.Version), qt.IsNil)
err = builder.Build()
c.Assert(err, qt.IsNil)
}