MCPcopy
hub / github.com/cloudflare/tableflip / TestMain

Function TestMain

upgrader_test.go:67–86  ·  view source on GitHub ↗
(m *testing.M)

Source from the content-addressed store, hash-verified

65var names = []string{"zaphod", "beeblebrox"}
66
67func TestMain(m *testing.M) {
68 upg, err := New(Options{})
69 if errors.Is(err, ErrNotSupported) {
70 fmt.Fprintln(os.Stderr, "Skipping tests, OS is not supported")
71 os.Exit(0)
72 }
73 if err != nil {
74 panic(err)
75 }
76
77 if upg.parent == nil {
78 // Execute test suite if there is no parent.
79 os.Exit(m.Run())
80 }
81
82 if err := childProcess(upg); err != nil {
83 fmt.Fprintf(os.Stderr, "Error: %s\n", err)
84 os.Exit(1)
85 }
86}
87
88type childState struct {
89 PID int

Callers

nothing calls this directly

Calls 3

childProcessFunction · 0.85
NewFunction · 0.70
ExitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…