Plan stuff. Log stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
383 B

4 years ago
  1. package bolt
  2. import (
  3. "fmt"
  4. "github.com/gisle/stufflog/config"
  5. "os"
  6. "testing"
  7. "time"
  8. )
  9. var db *Database
  10. var dbErr error
  11. func TestMain(m *testing.M) {
  12. ns := time.Now().Nanosecond()
  13. path := fmt.Sprintf("/tmp/stufflog_repos_test_%s_%d.db", time.Now().Format("20060102150405"), ns)
  14. db, dbErr = Init(config.Database{
  15. Driver: "bolt",
  16. Path: path,
  17. })
  18. os.Exit(m.Run())
  19. }