dao_test.go 342 B

123456789101112131415161718192021222324
  1. package dao
  2. import (
  3. "os"
  4. "testing"
  5. "go-common/app/job/main/dm/conf"
  6. "go-common/library/log"
  7. )
  8. var (
  9. testDao *Dao
  10. )
  11. func TestMain(m *testing.M) {
  12. conf.ConfPath = "../cmd/dm-job-test.toml"
  13. if err := conf.Init(); err != nil {
  14. panic(err)
  15. }
  16. log.Init(conf.Conf.Xlog)
  17. defer log.Close()
  18. testDao = New(conf.Conf)
  19. os.Exit(m.Run())
  20. }