Skip to content

Commit 0ef4b44

Browse files
committed
Output logs only if test.v is true
1 parent 7e1990b commit 0ef4b44

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/install_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func TestInstall(t *testing.T) {
8585
Program: "../gitea",
8686
WorkDir: "",
8787
Args: []string{"web", "--port", ServerHTTPPort},
88-
//LogFile: os.Stderr,
88+
LogFile: os.Stderr,
8989
}
9090

9191
if err := utils.New(t, &conf).RunTest(install); err != nil {

tests/internal/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (t *T) RunTest(tests ...func(*T) error) (err error) {
8888
cmd := exec.Command(newpath, t.Config.Args...)
8989
cmd.Dir = workdir
9090

91-
if t.Config.LogFile != nil {
91+
if t.Config.LogFile != nil && testing.Verbose() {
9292
if err := redirect(cmd, t.Config.LogFile); err != nil {
9393
return err
9494
}

0 commit comments

Comments
 (0)