net: disable multicast tests by default.

Fixes #1649.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4343056
This commit is contained in:
Dave Cheney 2011-04-11 10:39:21 +10:00 committed by Andrew Gerrand
parent dd4423292e
commit 8b8b54ad5c

View File

@ -5,14 +5,21 @@
package net
import (
"flag"
"runtime"
"testing"
)
var multicast = flag.Bool("multicast", false, "enable multicast tests")
func TestMulticastJoinAndLeave(t *testing.T) {
if runtime.GOOS == "windows" {
return
}
if !*multicast {
t.Logf("test disabled; use --multicast to enable")
return
}
addr := &UDPAddr{
IP: IPv4zero,
@ -40,6 +47,10 @@ func TestMulticastJoinAndLeave(t *testing.T) {
}
func TestJoinFailureWithIPv6Address(t *testing.T) {
if !*multicast {
t.Logf("test disabled; use --multicast to enable")
return
}
addr := &UDPAddr{
IP: IPv4zero,
Port: 0,