MCPcopy
hub / github.com/tinygo-org/tinygo / buildBinary

Function buildBinary

builder/sizes_test.go:118–140  ·  view source on GitHub ↗
(t *testing.T, targetString, pkgName string)

Source from the content-addressed store, hash-verified

116}
117
118func buildBinary(t *testing.T, targetString, pkgName string) BuildResult {
119 options := compileopts.Options{
120 Target: targetString,
121 Opt: "z",
122 Semaphore: sema,
123 InterpTimeout: 60 * time.Second,
124 Debug: true,
125 VerifyIR: true,
126 }
127 target, err := compileopts.LoadTarget(&options)
128 if err != nil {
129 t.Fatal("could not load target:", err)
130 }
131 config := &compileopts.Config{
132 Options: &options,
133 Target: target,
134 }
135 result, err := Build(pkgName, "", t.TempDir(), config)
136 if err != nil {
137 t.Fatal("could not build:", err)
138 }
139 return result
140}

Callers 2

TestBinarySizeFunction · 0.85
TestSizeFullFunction · 0.85

Calls 4

LoadTargetFunction · 0.92
BuildFunction · 0.70
FatalMethod · 0.65
TempDirMethod · 0.65

Tested by

no test coverage detected