MCPcopy
hub / github.com/hashicorp/hcl / TestMain

Function TestMain

specsuite/spec_test.go:18–31  ·  view source on GitHub ↗
(m *testing.M)

Source from the content-addressed store, hash-verified

16)
17
18func TestMain(m *testing.M) {
19 // The test harness is an external program that also expects to have
20 // hcldec built as an external program, so we'll build both into
21 // temporary files in our working directory before running our tests
22 // here, to ensure that we're always running a build of the latest code.
23 err := build()
24 if err != nil {
25 fmt.Fprintf(os.Stderr, "%s\n", err.Error())
26 os.Exit(1)
27 }
28
29 // Now we can run the tests
30 os.Exit(m.Run())
31}
32
33func build() error {
34 err := goBuild("github.com/hashicorp/hcl/v2/cmd/hcldec", "tmp_hcldec")

Callers

nothing calls this directly

Calls 4

buildFunction · 0.85
RunMethod · 0.80
ExitMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected