##// END OF EJS Templates
run-tests: make per-line condition support testcase names...
Jun Wu -
r33935:6cc8f848 default
parent child Browse files
Show More
@@ -1440,7 +1440,7 b' class TTest(Test):'
1440 conditions = [
1440 conditions = [
1441 c for c in m.group(2).split(b' ')]
1441 c for c in m.group(2).split(b' ')]
1442
1442
1443 if not self._hghave(conditions)[0]:
1443 if not self._iftest(conditions):
1444 optional.append(i)
1444 optional.append(i)
1445
1445
1446 i += 1
1446 i += 1
@@ -1474,7 +1474,7 b' class TTest(Test):'
1474 if m:
1474 if m:
1475 conditions = [c for c in m.group(2).split(b' ')]
1475 conditions = [c for c in m.group(2).split(b' ')]
1476
1476
1477 if self._hghave(conditions)[0]:
1477 if self._iftest(conditions):
1478 # Don't append as optional line
1478 # Don't append as optional line
1479 continue
1479 continue
1480 else:
1480 else:
@@ -1555,7 +1555,7 b' class TTest(Test):'
1555 conditions = [c for c in m.group(2).split(b' ')]
1555 conditions = [c for c in m.group(2).split(b' ')]
1556
1556
1557 el = m.group(1) + b"\n"
1557 el = m.group(1) + b"\n"
1558 if not self._hghave(conditions)[0]:
1558 if not self._iftest(conditions):
1559 retry = "retry" # Not required by listed features
1559 retry = "retry" # Not required by listed features
1560
1560
1561 if el.endswith(b" (esc)\n"):
1561 if el.endswith(b" (esc)\n"):
@@ -823,6 +823,20 b' When "#testcases" is used in .t files'
823 2
823 2
824 #endif
824 #endif
825
825
826 $ cat >> test-cases.t <<'EOF'
827 > #if a
828 > $ NAME=A
829 > #else
830 > $ NAME=B
831 > #endif
832 > $ echo $NAME
833 > A (a !)
834 > B (b !)
835 > EOF
836 $ rt test-cases.t
837 ..
838 # Ran 2 tests, 0 skipped, 0 failed.
839
826 $ rm test-cases.t
840 $ rm test-cases.t
827
841
828 (reinstall)
842 (reinstall)
General Comments 0
You need to be logged in to leave comments. Login now