comparison tests/run-tests.py @ 28180:2836a43c7722

run-tests: allow run-tests.py to run tests outside current directory When reloading tests, run-tests.py was assuming that it could look up the test by the basename, which only works if you are running tests which are in the current directory. This patch changes that lookup to use the full path. This is all that was needed, and does not appear to cause any problems for any of the existing testing work flows based on running the suggested commands at the top of run-tests.py. Motivation: In order to test Mercurial with Hypothesis (according to https://www.mercurial-scm.org/wiki/HypothesisPlan) it is useful to be able to generate temporary test files and execute them. Generating temporary files in the tests/ directory leads to a lot of suboptimal clutter.
author David R. MacIver <david@drmaciver.com>
date Thu, 18 Feb 2016 08:52:15 +0000
parents bc010fcd836b
children 0fe00bdb2f4f
comparison
equal deleted inserted replaced
28179:2e11f6756d9c 28180:2836a43c7722
1504 num_tests = [0] 1504 num_tests = [0]
1505 for test in self._tests: 1505 for test in self._tests:
1506 def get(): 1506 def get():
1507 num_tests[0] += 1 1507 num_tests[0] += 1
1508 if getattr(test, 'should_reload', False): 1508 if getattr(test, 'should_reload', False):
1509 return self._loadtest(test.bname, num_tests[0]) 1509 return self._loadtest(test.path, num_tests[0])
1510 return test 1510 return test
1511 if not os.path.exists(test.path): 1511 if not os.path.exists(test.path):
1512 result.addSkip(test, "Doesn't exist") 1512 result.addSkip(test, "Doesn't exist")
1513 continue 1513 continue
1514 1514