Skip to content

Commit 681a0ed

Browse files
committed
add Init in git tests
1 parent 13e231a commit 681a0ed

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

modules/git/git_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
5+
package git
6+
7+
import (
8+
"fmt"
9+
"os"
10+
"testing"
11+
)
12+
13+
func fatalTestError(fmtStr string, args ...interface{}) {
14+
fmt.Fprintf(os.Stderr, fmtStr, args...)
15+
os.Exit(1)
16+
}
17+
18+
func TestMain(m *testing.M) {
19+
if err := Init(); err != nil {
20+
fatalTestError("Init failed: %v", err)
21+
}
22+
23+
exitStatus := m.Run()
24+
os.Exit(exitStatus)
25+
}

0 commit comments

Comments
 (0)