##// END OF EJS Templates
run-tests: use count to calculate port to use...
Matt Mackall -
r19275:de44cf13 default
parent child Browse files
Show More
@@ -362,13 +362,13 b' def createhgrc(path, options):'
362 hgrc.write('[%s]\n%s\n' % (section, key))
362 hgrc.write('[%s]\n%s\n' % (section, key))
363 hgrc.close()
363 hgrc.close()
364
364
365 def createenv(options, testtmp, threadtmp):
365 def createenv(options, testtmp, threadtmp, port):
366 env = os.environ.copy()
366 env = os.environ.copy()
367 env['TESTTMP'] = testtmp
367 env['TESTTMP'] = testtmp
368 env['HOME'] = testtmp
368 env['HOME'] = testtmp
369 env["HGPORT"] = str(options.port)
369 env["HGPORT"] = str(port)
370 env["HGPORT1"] = str(options.port + 1)
370 env["HGPORT1"] = str(port + 1)
371 env["HGPORT2"] = str(options.port + 2)
371 env["HGPORT2"] = str(port + 2)
372 env["HGRCPATH"] = os.path.join(threadtmp, '.hgrc')
372 env["HGRCPATH"] = os.path.join(threadtmp, '.hgrc')
373 env["DAEMON_PIDS"] = os.path.join(threadtmp, 'daemon.pids')
373 env["DAEMON_PIDS"] = os.path.join(threadtmp, 'daemon.pids')
374 env["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
374 env["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
@@ -951,10 +951,11 b' def runone(options, test, count):'
951 os.mkdir(threadtmp)
951 os.mkdir(threadtmp)
952 os.mkdir(testtmp)
952 os.mkdir(testtmp)
953
953
954 port = options.port + count * 3
954 replacements = [
955 replacements = [
955 (r':%s\b' % options.port, ':$HGPORT'),
956 (r':%s\b' % port, ':$HGPORT'),
956 (r':%s\b' % (options.port + 1), ':$HGPORT1'),
957 (r':%s\b' % (port + 1), ':$HGPORT1'),
957 (r':%s\b' % (options.port + 2), ':$HGPORT2'),
958 (r':%s\b' % (port + 2), ':$HGPORT2'),
958 ]
959 ]
959 if os.name == 'nt':
960 if os.name == 'nt':
960 replacements.append(
961 replacements.append(
@@ -966,7 +967,7 b' def runone(options, test, count):'
966 else:
967 else:
967 replacements.append((re.escape(testtmp), '$TESTTMP'))
968 replacements.append((re.escape(testtmp), '$TESTTMP'))
968
969
969 env = createenv(options, testtmp, threadtmp)
970 env = createenv(options, testtmp, threadtmp, port)
970 createhgrc(env['HGRCPATH'], options)
971 createhgrc(env['HGRCPATH'], options)
971
972
972 if options.time:
973 if options.time:
General Comments 0
You need to be logged in to leave comments. Login now