Skip to content

Commit

Permalink
add Init in git tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Jun 19, 2019
1 parent 13e231a commit 681a0ed
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions modules/git/git_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package git

import (
"fmt"
"os"
"testing"
)

func fatalTestError(fmtStr string, args ...interface{}) {
fmt.Fprintf(os.Stderr, fmtStr, args...)
os.Exit(1)
}

func TestMain(m *testing.M) {
if err := Init(); err != nil {
fatalTestError("Init failed: %v", err)
}

exitStatus := m.Run()
os.Exit(exitStatus)
}

0 comments on commit 681a0ed

Please sign in to comment.