]> Cypherpunks repositories - gostls13.git/commitdiff
net: don't show verbose information when -test.v=false
authorMikio Hara <mikioh.mikioh@gmail.com>
Fri, 15 May 2015 03:10:10 +0000 (12:10 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Sat, 23 May 2015 01:13:51 +0000 (01:13 +0000)
Updates #10845.

Change-Id: I4cec670c7db88c50a6e5619e611744e161d73b3c
Reviewed-on: https://go-review.googlesource.com/10131
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/main_test.go

index ceec08911ed8b481217542da8e714676e3eec496..62b8997091e04eaae3040c594583ff94847ce699 100644 (file)
@@ -50,9 +50,9 @@ func TestMain(m *testing.M) {
        st := m.Run()
 
        testHookUninstaller.Do(uninstallTestHooks)
-       if !testing.Short() {
-               printLeakedGoroutines()
-               printLeakedSockets()
+       if testing.Verbose() {
+               printRunningGoroutines()
+               printInflightSockets()
                printSocketStats()
        }
        forceCloseSockets()
@@ -98,8 +98,8 @@ func setupTestData() {
        }
 }
 
-func printLeakedGoroutines() {
-       gss := leakedGoroutines()
+func printRunningGoroutines() {
+       gss := runningGoroutines()
        if len(gss) == 0 {
                return
        }
@@ -110,9 +110,8 @@ func printLeakedGoroutines() {
        fmt.Fprintf(os.Stderr, "\n")
 }
 
-// leakedGoroutines returns a list of remaining goroutines used in
-// test cases.
-func leakedGoroutines() []string {
+// runningGoroutines returns a list of remaining goroutines.
+func runningGoroutines() []string {
        var gss []string
        b := make([]byte, 2<<20)
        b = b[:runtime.Stack(b, true)]
@@ -131,7 +130,7 @@ func leakedGoroutines() []string {
        return gss
 }
 
-func printLeakedSockets() {
+func printInflightSockets() {
        sos := sw.Sockets()
        if len(sos) == 0 {
                return