##// END OF EJS Templates
run-tests: extract logic to get errpath in a utility func...
Sushil khanchi -
r45968:543e4462 default
parent child Browse files
Show More
@@ -3248,15 +3248,7 b' class TestRunner(object):'
3248 if self.options.retest:
3248 if self.options.retest:
3249 retest_args = []
3249 retest_args = []
3250 for test in tests:
3250 for test in tests:
3251 if 'case' in test:
3251 errpath = self._geterrpath(test)
3252 # for multiple dimensions test cases
3253 casestr = b'#'.join(test['case'])
3254 errpath = b'%s#%s.err' % (test['path'], casestr)
3255 else:
3256 errpath = b'%s.err' % test['path']
3257 if self.options.outputdir:
3258 errpath = os.path.join(self.options.outputdir, errpath)
3259
3260 if os.path.exists(errpath):
3252 if os.path.exists(errpath):
3261 retest_args.append(test)
3253 retest_args.append(test)
3262 tests = retest_args
3254 tests = retest_args
@@ -3276,13 +3268,7 b' class TestRunner(object):'
3276 orig = list(testdescs)
3268 orig = list(testdescs)
3277 while testdescs:
3269 while testdescs:
3278 desc = testdescs[0]
3270 desc = testdescs[0]
3279 # desc['path'] is a relative path
3271 errpath = self._geterrpath(desc)
3280 if 'case' in desc:
3281 casestr = b'#'.join(desc['case'])
3282 errpath = b'%s#%s.err' % (desc['path'], casestr)
3283 else:
3284 errpath = b'%s.err' % desc['path']
3285 errpath = os.path.join(self._outputdir, errpath)
3286 if os.path.exists(errpath):
3272 if os.path.exists(errpath):
3287 break
3273 break
3288 testdescs.pop(0)
3274 testdescs.pop(0)
@@ -3352,6 +3338,18 b' class TestRunner(object):'
3352 if failed:
3338 if failed:
3353 return 1
3339 return 1
3354
3340
3341 def _geterrpath(self, test):
3342 # test['path'] is a relative path
3343 if 'case' in test:
3344 # for multiple dimensions test cases
3345 casestr = b'#'.join(test['case'])
3346 errpath = b'%s#%s.err' % (test['path'], casestr)
3347 else:
3348 errpath = b'%s.err' % test['path']
3349 if self.options.outputdir:
3350 errpath = os.path.join(self.options.outputdir, errpath)
3351 return errpath
3352
3355 def _getport(self, count):
3353 def _getport(self, count):
3356 port = self._ports.get(count) # do we have a cached entry?
3354 port = self._ports.get(count) # do we have a cached entry?
3357 if port is None:
3355 if port is None:
General Comments 0
You need to be logged in to leave comments. Login now