MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / TestMain

Function TestMain

examples/internal/integration/main_test.go:76–99  ·  view source on GitHub ↗
(m *testing.M)

Source from the content-addressed store, hash-verified

74}
75
76func TestMain(m *testing.M) {
77 flag.Parse()
78
79 ctx, cancel := context.WithCancel(context.Background())
80 defer cancel()
81 errCh := runServers(ctx)
82
83 ch := make(chan int, 1)
84 go func() {
85 if err := waitForGateway(ctx, 8088); err != nil {
86 grpclog.Errorf("waitForGateway(ctx, 8088) failed with %v; want success", err)
87 }
88 ch <- m.Run()
89 }()
90
91 select {
92 case err := <-errCh:
93 fmt.Fprintln(os.Stderr, err)
94 os.Exit(1)
95 case status := <-ch:
96 cancel()
97 os.Exit(status)
98 }
99}

Callers

nothing calls this directly

Calls 3

runServersFunction · 0.85
waitForGatewayFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected