service_test.go 433 B

12345678910111213141516171819202122232425
  1. package v1
  2. import (
  3. "go-common/app/interface/live/app-room/conf"
  4. "go-common/library/log"
  5. "os"
  6. "testing"
  7. )
  8. var (
  9. testGiftService *GiftService
  10. s *GiftService
  11. )
  12. func TestMain(m *testing.M) {
  13. conf.ConfPath = "../../cmd/test.toml"
  14. if err := conf.Init(); err != nil {
  15. panic(err)
  16. }
  17. log.Init(conf.Conf.Log)
  18. defer log.Close()
  19. testGiftService = NewGiftService(conf.Conf)
  20. s = testGiftService
  21. os.Exit(m.Run())
  22. }