changeset 16905:671c73d523cf

tests: make .t tests stop immediately if a cd fails This prevents tests from escaping from TESTTMP as a consequence of a failing directory creation.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 10 Jun 2012 18:50:42 +0200
parents 9d0f988364bd
children 2a95830cff77
files tests/run-tests.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun Jun 10 18:28:42 2012 +0200
+++ b/tests/run-tests.py	Sun Jun 10 18:50:42 2012 +0200
@@ -659,6 +659,9 @@
             prepos = pos
             pos = n
             addsalt(n, False)
+            cmd = l[4:].split()
+            if len(cmd) == 2 and cmd[0] == 'cd':
+                l = '  $ cd %s || exit 1\n' % cmd[1]
             script.append(l[4:])
         elif l.startswith('  > '): # continuations
             after.setdefault(prepos, []).append(l)