comparison tests/run-tests.py @ 41138:8ddc5d8bea25

tests: support passing testcase after .t paths that have path separators This probably could have been implemented by changing the regex above this bit of code, but I wasn't sure if it would end up handling various OSes correctly, so I decided to go with this version instead. Previously: $ tests/run-tests.py tests/test-ssh.t -l running 2 tests using 2 parallel processes .. # Ran 2 tests, 0 skipped, 0 failed. $ tests/run-tests.py tests/test-ssh.t#sshv1 -l running 0 tests using 0 parallel processes # Ran 0 tests, 0 skipped, 0 failed. Now: $ tests/run-tests.py tests/test-ssh.t -l running 2 tests using 2 parallel processes .. # Ran 2 tests, 0 skipped, 0 failed. $ tests/run-tests.py tests/test-ssh.t#sshv1 -l running 1 tests using 1 parallel processes . # Ran 1 tests, 0 skipped, 0 failed. Differential Revision: https://phab.mercurial-scm.org/D5535
author Kyle Lippincott <spectral@google.com>
date Tue, 08 Jan 2019 17:52:39 -0800
parents e10adebf8176
children 89d103fc9c19
comparison
equal deleted inserted replaced
41137:785a75f0ddcb 41138:8ddc5d8bea25
2792 case = [] 2792 case = []
2793 2793
2794 if not (os.path.basename(t).startswith(b'test-') 2794 if not (os.path.basename(t).startswith(b'test-')
2795 and (t.endswith(b'.py') or t.endswith(b'.t'))): 2795 and (t.endswith(b'.py') or t.endswith(b'.t'))):
2796 2796
2797 m = testcasepattern.match(t) 2797 m = testcasepattern.match(os.path.basename(t))
2798 if m is not None: 2798 if m is not None:
2799 t, _, casestr = m.groups() 2799 t_basename, _, casestr = m.groups()
2800 t = os.path.join(os.path.dirname(t), t_basename)
2800 if casestr: 2801 if casestr:
2801 case = casestr.split(b'#') 2802 case = casestr.split(b'#')
2802 else: 2803 else:
2803 continue 2804 continue
2804 2805