(m *testing.M)
| 11 | ) |
| 12 | |
| 13 | func TestMain(m *testing.M) { |
| 14 | if err := registerManagedHTTP(); err != nil { |
| 15 | panic(err) |
| 16 | } |
| 17 | |
| 18 | ret := m.Run() |
| 19 | |
| 20 | if err := unregisterManagedTransports(); err != nil { |
| 21 | panic(err) |
| 22 | } |
| 23 | |
| 24 | // Ensure that we are not leaking any pointer handles. |
| 25 | pointerHandles.Lock() |
| 26 | if len(pointerHandles.handles) > 0 { |
| 27 | for h, ptr := range pointerHandles.handles { |
| 28 | fmt.Printf("%016p: %v %+v\n", h, reflect.TypeOf(ptr), ptr) |
| 29 | } |
| 30 | panic("pointer handle list not empty") |
| 31 | } |
| 32 | pointerHandles.Unlock() |
| 33 | |
| 34 | // Or remote pointers. |
| 35 | remotePointers.Lock() |
| 36 | if len(remotePointers.pointers) > 0 { |
| 37 | for ptr, remote := range remotePointers.pointers { |
| 38 | fmt.Printf("%016p: %+v\n", ptr, remote) |
| 39 | } |
| 40 | panic("remote pointer list not empty") |
| 41 | } |
| 42 | remotePointers.Unlock() |
| 43 | |
| 44 | Shutdown() |
| 45 | |
| 46 | os.Exit(ret) |
| 47 | } |
| 48 | |
| 49 | func cleanupTestRepo(t *testing.T, r *Repository) { |
| 50 | var err error |
nothing calls this directly
no test coverage detected
searching dependent graphs…