You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

git_test.go 510B

1234567891011121314151617181920212223242526
  1. // Copyright 2019 The Gitea 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 git
  5. import (
  6. "context"
  7. "fmt"
  8. "os"
  9. "testing"
  10. )
  11. func fatalTestError(fmtStr string, args ...interface{}) {
  12. fmt.Fprintf(os.Stderr, fmtStr, args...)
  13. os.Exit(1)
  14. }
  15. func TestMain(m *testing.M) {
  16. if err := Init(context.Background()); err != nil {
  17. fatalTestError("Init failed: %v", err)
  18. }
  19. exitStatus := m.Run()
  20. os.Exit(exitStatus)
  21. }