##// 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 else:
137 else:
138 return False
138 return False
139
139
140 # IPv6 is used if IPv4 is not available and IPv6 is available.
140 # useipv6 will be set by parseargs
141 useipv6 = (not checksocketfamily('AF_INET')) and checksocketfamily('AF_INET6')
141 useipv6 = None
142
142
143 def checkportisavailable(port):
143 def checkportisavailable(port):
144 """return true if a port seems free to bind on localhost"""
144 """return true if a port seems free to bind on localhost"""
@@ -302,6 +302,8 b' def getparser():'
302 help="install and use chg wrapper in place of hg")
302 help="install and use chg wrapper in place of hg")
303 parser.add_option("--with-chg", metavar="CHG",
303 parser.add_option("--with-chg", metavar="CHG",
304 help="use specified chg wrapper in place of hg")
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 parser.add_option("-3", "--py3k-warnings", action="store_true",
307 parser.add_option("-3", "--py3k-warnings", action="store_true",
306 help="enable Py3k warnings on Python 2.6+")
308 help="enable Py3k warnings on Python 2.6+")
307 # This option should be deleted once test-check-py3-compat.t and other
309 # This option should be deleted once test-check-py3-compat.t and other
@@ -371,6 +373,14 b' def parseargs(args, parser):'
371 parser.error('--chg does not work when --with-hg is specified '
373 parser.error('--chg does not work when --with-hg is specified '
372 '(use --with-chg instead)')
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 options.anycoverage = options.cover or options.annotate or options.htmlcov
384 options.anycoverage = options.cover or options.annotate or options.htmlcov
375 if options.anycoverage:
385 if options.anycoverage:
376 try:
386 try:
General Comments 0
You need to be logged in to leave comments. Login now