# HG changeset patch # User Mads Kiilerich # Date 2012-06-10 16:50:42 # Node ID 671c73d523cfafb92258559ffaa31becc6b6785c # Parent 9d0f988364bdaac503ee2d52ad310882dce0809d 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. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -659,6 +659,9 @@ def tsttest(test, wd, options, replaceme 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)