From cb3472a4d372de247850fb1386567738c7b50b3e Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sun, 10 Jun 2012 18:50:42 +0200 Subject: [PATCH] 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. --- tests/run-tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/run-tests.py b/tests/run-tests.py index cd98517396..c85e7d3c76 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -659,6 +659,9 @@ def tsttest(test, wd, options, replacements): 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)