service_test.go 310 B

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