comparison tests/run-tests.py @ 39379:b64d36e5ca31

run-tests: replace '/dev/null' with os.devnull for Windows Many of the *.py tests were dying on: File "c:\Users\Matt\projects\hg\hgdemandimport\tracing.py", line 27, in log _pipe = open(os.environ['HGCATAPULTSERVERPIPE'], 'w', 1) IOError: [Errno 2] $ENOENT$: '/dev/null'
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 29 Aug 2018 23:39:58 -0400
parents 97f52862b1bd
children f57682dca1c1
comparison
equal deleted inserted replaced
39378:0f549da54379 39379:b64d36e5ca31
1070 env["HGENCODING"] = "ascii" 1070 env["HGENCODING"] = "ascii"
1071 env["HGENCODINGMODE"] = "strict" 1071 env["HGENCODINGMODE"] = "strict"
1072 env["HGHOSTNAME"] = "test-hostname" 1072 env["HGHOSTNAME"] = "test-hostname"
1073 env['HGIPV6'] = str(int(self._useipv6)) 1073 env['HGIPV6'] = str(int(self._useipv6))
1074 if 'HGCATAPULTSERVERPIPE' not in env: 1074 if 'HGCATAPULTSERVERPIPE' not in env:
1075 env['HGCATAPULTSERVERPIPE'] = '/dev/null' 1075 env['HGCATAPULTSERVERPIPE'] = os.devnull
1076 1076
1077 extraextensions = [] 1077 extraextensions = []
1078 for opt in self._extraconfigopts: 1078 for opt in self._extraconfigopts:
1079 section, key = opt.encode('utf-8').split(b'.', 1) 1079 section, key = opt.encode('utf-8').split(b'.', 1)
1080 if section != 'extensions': 1080 if section != 'extensions':
1388 script.append(b'alias hg="%s"\n' % self._hgcommand) 1388 script.append(b'alias hg="%s"\n' % self._hgcommand)
1389 if os.getenv('MSYSTEM'): 1389 if os.getenv('MSYSTEM'):
1390 script.append(b'alias pwd="pwd -W"\n') 1390 script.append(b'alias pwd="pwd -W"\n')
1391 1391
1392 hgcatapult = os.getenv('HGCATAPULTSERVERPIPE') 1392 hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
1393 if hgcatapult and hgcatapult != '/dev/null': 1393 if hgcatapult and hgcatapult != os.devnull:
1394 # Kludge: use a while loop to keep the pipe from getting 1394 # Kludge: use a while loop to keep the pipe from getting
1395 # closed by our echo commands. The still-running file gets 1395 # closed by our echo commands. The still-running file gets
1396 # reaped at the end of the script, which causes the while 1396 # reaped at the end of the script, which causes the while
1397 # loop to exit and closes the pipe. Sigh. 1397 # loop to exit and closes the pipe. Sigh.
1398 script.append( 1398 script.append(