]> Sergey Matveev's repositories - btrtrc.git/blob - main_test.go
Remove test temporary directories when finished
[btrtrc.git] / main_test.go
1 package torrent
2
3 import (
4         "io/ioutil"
5         "log"
6         "os"
7         "testing"
8 )
9
10 var tempDir string
11
12 func init() {
13         log.SetFlags(log.LstdFlags | log.Llongfile)
14         var err error
15         tempDir, err = ioutil.TempDir("", "torrent.test")
16         if err != nil {
17                 panic(err)
18         }
19 }
20
21 func TestMain(m *testing.M) {
22         code := m.Run()
23         os.RemoveAll(tempDir)
24         // select {}
25         os.Exit(code)
26 }