]> Sergey Matveev's repositories - btrtrc.git/blob - testing.go
Extract the transfer tests
[btrtrc.git] / testing.go
1 package torrent
2
3 import (
4         "github.com/anacrolix/torrent/internal/tmproot"
5 )
6
7 var TestingTempDir tmproot.Dir
8
9 func TestingConfig() *ClientConfig {
10         cfg := NewDefaultClientConfig()
11         cfg.ListenHost = LoopbackListenHost
12         cfg.NoDHT = true
13         cfg.DataDir = TestingTempDir.NewSub()
14         cfg.DisableTrackers = true
15         cfg.NoDefaultPortForwarding = true
16         cfg.DisableAcceptRateLimiting = true
17         cfg.ListenPort = 0
18         //cfg.Debug = true
19         //cfg.Logger = cfg.Logger.WithText(func(m log.Msg) string {
20         //      t := m.Text()
21         //      m.Values(func(i interface{}) bool {
22         //              t += fmt.Sprintf("\n%[1]T: %[1]v", i)
23         //              return true
24         //      })
25         //      return t
26         //})
27         return cfg
28 }