25 lines
383 B
Go
25 lines
383 B
Go
package bolt
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gisle/stufflog/config"
|
|
"os"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
var db *Database
|
|
var dbErr error
|
|
|
|
func TestMain(m *testing.M) {
|
|
ns := time.Now().Nanosecond()
|
|
path := fmt.Sprintf("/tmp/stufflog_repos_test_%s_%d.db", time.Now().Format("20060102150405"), ns)
|
|
|
|
db, dbErr = Init(config.Database{
|
|
Driver: "bolt",
|
|
Path: path,
|
|
})
|
|
|
|
os.Exit(m.Run())
|
|
}
|