##// END OF EJS Templates
runtests: add an IPv6 command line flag...
Jun Wu -
r31011:01eebb65 default
parent child Browse files
Show More
@@ -137,8 +137,8 b' def checksocketfamily(name, port=20058):'
137 137 else:
138 138 return False
139 139
140 # IPv6 is used if IPv4 is not available and IPv6 is available.
141 useipv6 = (not checksocketfamily('AF_INET')) and checksocketfamily('AF_INET6')
140 # useipv6 will be set by parseargs
141 useipv6 = None
142 142
143 143 def checkportisavailable(port):
144 144 """return true if a port seems free to bind on localhost"""
@@ -302,6 +302,8 b' def getparser():'
302 302 help="install and use chg wrapper in place of hg")
303 303 parser.add_option("--with-chg", metavar="CHG",
304 304 help="use specified chg wrapper in place of hg")
305 parser.add_option("--ipv6", action="store_true",
306 help="prefer IPv6 to IPv4 for network related tests")
305 307 parser.add_option("-3", "--py3k-warnings", action="store_true",
306 308 help="enable Py3k warnings on Python 2.6+")
307 309 # This option should be deleted once test-check-py3-compat.t and other
@@ -371,6 +373,14 b' def parseargs(args, parser):'
371 373 parser.error('--chg does not work when --with-hg is specified '
372 374 '(use --with-chg instead)')
373 375
376 global useipv6
377 if options.ipv6:
378 useipv6 = checksocketfamily('AF_INET6')
379 else:
380 # only use IPv6 if IPv4 is unavailable and IPv6 is available
381 useipv6 = ((not checksocketfamily('AF_INET'))
382 and checksocketfamily('AF_INET6'))
383
374 384 options.anycoverage = options.cover or options.annotate or options.htmlcov
375 385 if options.anycoverage:
376 386 try:
General Comments 0
You need to be logged in to leave comments. Login now