]> Cypherpunks repositories - gostls13.git/commitdiff
net: make -external flag for tests default to true
authorMikio Hara <mikioh.mikioh@gmail.com>
Wed, 29 Feb 2012 22:39:03 +0000 (07:39 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Wed, 29 Feb 2012 22:39:03 +0000 (07:39 +0900)
go test -short # like in the build; no external stuff
go test # long tests, + external
go test -external=false # long tests, no external

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5696079

src/pkg/net/dialgoogle_test.go
src/pkg/net/lookup_test.go

index 14356da4ce368fe1d0e5f654e05e5a0c43b0cbf0..03c4499720f02cb88e5c9af2a6d145c4edf339d6 100644 (file)
@@ -42,9 +42,8 @@ func doDial(t *testing.T, network, addr string) {
 }
 
 func TestLookupCNAME(t *testing.T) {
-       if testing.Short() {
-               // Don't use external network.
-               t.Logf("skipping external network test during -short")
+       if testing.Short() || !*testExternal {
+               t.Logf("skipping test to avoid external network")
                return
        }
        cname, err := LookupCNAME("www.google.com")
@@ -67,9 +66,8 @@ var googleaddrsipv4 = []string{
 }
 
 func TestDialGoogleIPv4(t *testing.T) {
-       if testing.Short() {
-               // Don't use external network.
-               t.Logf("skipping external network test during -short")
+       if testing.Short() || !*testExternal {
+               t.Logf("skipping test to avoid external network")
                return
        }
 
@@ -124,9 +122,8 @@ var googleaddrsipv6 = []string{
 }
 
 func TestDialGoogleIPv6(t *testing.T) {
-       if testing.Short() {
-               // Don't use external network.
-               t.Logf("skipping external network test during -short")
+       if testing.Short() || !*testExternal {
+               t.Logf("skipping test to avoid external network")
                return
        }
        // Only run tcp6 if the kernel will take it.
index b5e9e63e0bd597df96e4d3ff79576fafcd5fff47..3a61dfb29c2ce77759a8700bcbeaa7a26c3c7eeb 100644 (file)
@@ -12,7 +12,7 @@ import (
        "testing"
 )
 
-var testExternal = flag.Bool("external", false, "allow use of external networks during test")
+var testExternal = flag.Bool("external", true, "allow use of external networks during long test")
 
 func TestGoogleSRV(t *testing.T) {
        if testing.Short() || !*testExternal {