MCPcopy Create free account
hub / github.com/RainbowMango/GoExpertProgramming / TestSubParallel

Function TestSubParallel

source/gotest/subparallel_test.go:30–42  ·  view source on GitHub ↗

TestSubParallel 通过把多个子测试放到一个组中并发执行,同时多个子测试可以共享setup和tear-down

(t *testing.T)

Source from the content-addressed store, hash-verified

28
29// TestSubParallel 通过把多个子测试放到一个组中并发执行,同时多个子测试可以共享setup和tear-down
30func TestSubParallel(t *testing.T) {
31 // setup
32 t.Logf("Setup")
33
34 t.Run("group", func(t *testing.T) {
35 t.Run("Test1", parallelTest1)
36 t.Run("Test2", parallelTest2)
37 t.Run("Test3", parallelTest3)
38 })
39
40 // tear down
41 t.Logf("teardown")
42}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected