MCPcopy
hub / github.com/perkeep/perkeep / Build

Method Build

pkg/test/world.go:89–128  ·  view source on GitHub ↗

Build builds the Perkeep binaries.

()

Source from the content-addressed store, hash-verified

87
88// Build builds the Perkeep binaries.
89func (w *World) Build() error {
90 var err error
91 w.tempDir, err = os.MkdirTemp("", "perkeep-test-")
92 if err != nil {
93 return err
94 }
95 w.gobin = filepath.Join(w.tempDir, "bin")
96 if err := os.MkdirAll(w.gobin, 0700); err != nil {
97 return err
98 }
99 // Build.
100 {
101 cmd := exec.Command("go", "run", "make.go",
102 "--stampversion=false",
103 "--targets="+strings.Join([]string{
104 "perkeep.org/server/perkeepd",
105 "perkeep.org/cmd/pk",
106 "perkeep.org/cmd/pk-get",
107 "perkeep.org/cmd/pk-put",
108 "perkeep.org/cmd/pk-mount",
109 }, ","))
110 if testing.Verbose() {
111 // TODO(mpl): do the same when -verbose with devcam test. Even better: see if testing.Verbose
112 // can be made true if devcam test -verbose ?
113 cmd.Args = append(cmd.Args, "-v=true")
114 }
115 cmd.Dir = w.srcRoot
116 cmd.Env = append(os.Environ(), "GOBIN="+w.gobin)
117 log.Print("Running make.go to build perkeep binaries for testing...")
118 out, err := cmd.CombinedOutput()
119 if err != nil {
120 return fmt.Errorf("Error building world: %v, %s", err, string(out))
121 }
122 if testing.Verbose() {
123 log.Printf("%s\n", out)
124 }
125 log.Print("Ran make.go.")
126 }
127 return nil
128}
129
130// Help outputs the help of perkeepd from the World.
131func (w *World) Help() ([]byte, error) {

Callers 2

HelpMethod · 0.95
StartMethod · 0.95

Implementers 2

testWorldpkg/gc/gc_test.go
Worldpkg/test/world.go

Calls 3

PrintfMethod · 0.80
MkdirAllMethod · 0.65
CommandMethod · 0.65

Tested by

no test coverage detected