service_test.go 414 B

1234567891011121314151617181920212223242526
  1. package newcomer
  2. import (
  3. "flag"
  4. "os"
  5. "testing"
  6. "go-common/app/interface/main/creative/conf"
  7. "go-common/app/interface/main/creative/service"
  8. )
  9. var (
  10. s *Service
  11. )
  12. func TestMain(m *testing.M) {
  13. flag.Set("conf", "../../cmd/creative.toml")
  14. flag.Parse()
  15. if err := conf.Init(); err != nil {
  16. panic(err)
  17. }
  18. rpcdaos := service.NewRPCDaos(conf.Conf)
  19. s = New(conf.Conf, rpcdaos)
  20. m.Run()
  21. os.Exit(m.Run())
  22. }