]> Sergey Matveev's repositories - btrtrc.git/blobdiff - main_test.go
Drop support for go 1.20
[btrtrc.git] / main_test.go
index 26433fb4c09f08a616a6fd1a77ffe7aca40556e6..578d992178d744a4d892bd692f7114a13a8477c4 100644 (file)
@@ -1,36 +1,21 @@
 package torrent
 
 import (
-       "io/ioutil"
        "log"
        "os"
        "testing"
-)
 
-// A top-level temp dir that lasts for the duration of the package tests, and
-// is removed at completion.
-var pkgTempDir string
+       _ "github.com/anacrolix/envpprof"
+       analog "github.com/anacrolix/log"
+)
 
 func init() {
        log.SetFlags(log.LstdFlags | log.Lshortfile)
-       var err error
-       pkgTempDir, err = ioutil.TempDir("", "torrent.test")
-       if err != nil {
-               panic(err)
-       }
-}
-
-func tempDir() string {
-       ret, err := ioutil.TempDir(pkgTempDir, "")
-       if err != nil {
-               panic(err)
-       }
-       return ret
+       analog.DefaultTimeFormatter = analog.TimeFormatSecondsSinceInit
 }
 
 func TestMain(m *testing.M) {
        code := m.Run()
-       os.RemoveAll(pkgTempDir)
        // select {}
        os.Exit(code)
 }