Mercurial > public > mercurial-scm > hg-stable
diff tests/run-tests.py @ 12316:4134686b83e1
tests: add exit codes to unified tests
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 16 Sep 2010 17:51:32 -0500 |
parents | 6f59154fb604 |
children | b016fc1c0862 |
line wrap: on
line diff
--- a/tests/run-tests.py Thu Sep 16 16:12:26 2010 -0500 +++ b/tests/run-tests.py Thu Sep 16 17:51:32 2010 -0500 @@ -474,7 +474,7 @@ after.setdefault(pos, []).append(l) prepos = pos pos = n - script.append('echo %s %s\n' % (salt, n)) + script.append('echo %s %s $?\n' % (salt, n)) script.append(l[4:]) elif l.startswith(' > '): # continuations after.setdefault(prepos, []).append(l) @@ -486,6 +486,8 @@ # non-command/result - queue up for merged output after.setdefault(pos, []).append(l) + script.append('echo %s %s $?\n' % (salt, n + 1)) + fd, name = tempfile.mkstemp(suffix='hg-tst') try: @@ -508,8 +510,13 @@ pos = -1 postout = [] + ret = 0 for n, l in enumerate(output): if l.startswith(salt): + # add on last return code + ret = int(l.split()[2]) + if ret != 0: + postout.append(" [%s]\n" % ret) if pos in after: postout += after.pop(pos) pos = int(l.split()[1])