]> Cypherpunks.ru repositories - goredo.git/blob - t/apenwarr/122-defaults-parent/all.do
Import tests from apenwarr/redo and redo.sh
[goredo.git] / t / apenwarr / 122-defaults-parent / all.do
1 rm -f x/shouldfail
2
3 log=$PWD/$1.log
4
5 expect_fail() {
6         local rv=$1
7         shift
8         if ("$@") >>$log 2>&1; then
9                 cat "$log" >&2
10                 echo "unexpected success:" "$@" >&2
11                 return $rv
12         else
13                 return 0
14         fi
15 }
16
17 # These should all fail because there is no matching .do file.
18 # In previous versions of redo, it would accidentally try to use
19 # $PWD/default.do even for ../path/file, which is incorrect.  That
20 # could cause it to return success accidentally.
21
22 rm -f "$log"
23 cd inner
24 expect_fail 11 redo ../x/shouldfail
25 expect_fail 12 redo-ifchange ../x/shouldfail
26
27 rm -f "$log"
28 cd ../inner2
29 expect_fail 21 redo ../x/shouldfail2
30 expect_fail 22 redo-ifchange ../x/shouldfail2
31
32 exit 0