main_test.go 576 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2020 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package lfs
  5. import (
  6. "flag"
  7. "fmt"
  8. "os"
  9. "testing"
  10. log "unknwon.dev/clog/v2"
  11. "gogs.io/gogs/internal/testutil"
  12. )
  13. func TestMain(m *testing.M) {
  14. flag.Parse()
  15. if !testing.Verbose() {
  16. // Remove the primary logger and register a noop logger.
  17. log.Remove(log.DefaultConsoleName)
  18. err := log.New("noop", testutil.InitNoopLogger)
  19. if err != nil {
  20. fmt.Println(err)
  21. os.Exit(1)
  22. }
  23. }
  24. os.Exit(m.Run())
  25. }