##// END OF EJS Templates
run-tests: use bytes when constructing shell script
Augie Fackler -
r25035:1203ca70 default
parent child Browse files
Show More
@@ -923,37 +923,37 b' class TTest(Test):'
923 script.append('alias pwd="pwd -W"\n')
923 script.append('alias pwd="pwd -W"\n')
924
924
925 for n, l in enumerate(lines):
925 for n, l in enumerate(lines):
926 if not l.endswith('\n'):
926 if not l.endswith(b'\n'):
927 l += '\n'
927 l += b'\n'
928 if l.startswith('#require'):
928 if l.startswith(b'#require'):
929 lsplit = l.split()
929 lsplit = l.split()
930 if len(lsplit) < 2 or lsplit[0] != '#require':
930 if len(lsplit) < 2 or lsplit[0] != b'#require':
931 after.setdefault(pos, []).append(' !!! invalid #require\n')
931 after.setdefault(pos, []).append(' !!! invalid #require\n')
932 if not self._hghave(lsplit[1:]):
932 if not self._hghave(lsplit[1:]):
933 script = ["exit 80\n"]
933 script = ["exit 80\n"]
934 break
934 break
935 after.setdefault(pos, []).append(l)
935 after.setdefault(pos, []).append(l)
936 elif l.startswith('#if'):
936 elif l.startswith(b'#if'):
937 lsplit = l.split()
937 lsplit = l.split()
938 if len(lsplit) < 2 or lsplit[0] != '#if':
938 if len(lsplit) < 2 or lsplit[0] != b'#if':
939 after.setdefault(pos, []).append(' !!! invalid #if\n')
939 after.setdefault(pos, []).append(' !!! invalid #if\n')
940 if skipping is not None:
940 if skipping is not None:
941 after.setdefault(pos, []).append(' !!! nested #if\n')
941 after.setdefault(pos, []).append(' !!! nested #if\n')
942 skipping = not self._hghave(lsplit[1:])
942 skipping = not self._hghave(lsplit[1:])
943 after.setdefault(pos, []).append(l)
943 after.setdefault(pos, []).append(l)
944 elif l.startswith('#else'):
944 elif l.startswith(b'#else'):
945 if skipping is None:
945 if skipping is None:
946 after.setdefault(pos, []).append(' !!! missing #if\n')
946 after.setdefault(pos, []).append(' !!! missing #if\n')
947 skipping = not skipping
947 skipping = not skipping
948 after.setdefault(pos, []).append(l)
948 after.setdefault(pos, []).append(l)
949 elif l.startswith('#endif'):
949 elif l.startswith(b'#endif'):
950 if skipping is None:
950 if skipping is None:
951 after.setdefault(pos, []).append(' !!! missing #if\n')
951 after.setdefault(pos, []).append(' !!! missing #if\n')
952 skipping = None
952 skipping = None
953 after.setdefault(pos, []).append(l)
953 after.setdefault(pos, []).append(l)
954 elif skipping:
954 elif skipping:
955 after.setdefault(pos, []).append(l)
955 after.setdefault(pos, []).append(l)
956 elif l.startswith(' >>> '): # python inlines
956 elif l.startswith(b' >>> '): # python inlines
957 after.setdefault(pos, []).append(l)
957 after.setdefault(pos, []).append(l)
958 prepos = pos
958 prepos = pos
959 pos = n
959 pos = n
@@ -964,10 +964,10 b' class TTest(Test):'
964 script.append('%s -m heredoctest <<EOF\n' % PYTHON)
964 script.append('%s -m heredoctest <<EOF\n' % PYTHON)
965 addsalt(n, True)
965 addsalt(n, True)
966 script.append(l[2:])
966 script.append(l[2:])
967 elif l.startswith(' ... '): # python inlines
967 elif l.startswith(b' ... '): # python inlines
968 after.setdefault(prepos, []).append(l)
968 after.setdefault(prepos, []).append(l)
969 script.append(l[2:])
969 script.append(l[2:])
970 elif l.startswith(' $ '): # commands
970 elif l.startswith(b' $ '): # commands
971 if inpython:
971 if inpython:
972 script.append('EOF\n')
972 script.append('EOF\n')
973 inpython = False
973 inpython = False
@@ -979,10 +979,10 b' class TTest(Test):'
979 if len(cmd) == 2 and cmd[0] == 'cd':
979 if len(cmd) == 2 and cmd[0] == 'cd':
980 l = ' $ cd %s || exit 1\n' % cmd[1]
980 l = ' $ cd %s || exit 1\n' % cmd[1]
981 script.append(l[4:])
981 script.append(l[4:])
982 elif l.startswith(' > '): # continuations
982 elif l.startswith(b' > '): # continuations
983 after.setdefault(prepos, []).append(l)
983 after.setdefault(prepos, []).append(l)
984 script.append(l[4:])
984 script.append(l[4:])
985 elif l.startswith(' '): # results
985 elif l.startswith(b' '): # results
986 # Queue up a list of expected results.
986 # Queue up a list of expected results.
987 expected.setdefault(pos, []).append(l[2:])
987 expected.setdefault(pos, []).append(l[2:])
988 else:
988 else:
General Comments 0
You need to be logged in to leave comments. Login now