package torrent
import (
- "io/ioutil"
"log"
"os"
"testing"
-)
-var tempDir string
+ _ "github.com/anacrolix/envpprof"
+ analog "github.com/anacrolix/log"
+)
func init() {
- log.SetFlags(log.LstdFlags | log.Llongfile)
- var err error
- tempDir, err = ioutil.TempDir("", "torrent.test")
- if err != nil {
- panic(err)
- }
+ log.SetFlags(log.LstdFlags | log.Lshortfile)
+ analog.DefaultTimeFormatter = analog.TimeFormatSecondsSinceInit
}
func TestMain(m *testing.M) {
code := m.Run()
- os.RemoveAll(tempDir)
// select {}
os.Exit(code)
}