blob: 58bf0196ac66aa124e33185f64eb870aa2232e31 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/bin/sh -e
# Copyright (c) 2015-2016 Tharre
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
test_description='Abort if do-script returns nonzero'
. ./sharness.sh
cat > "fail.do" <<'EOF'
#!/bin/sh -e
echo "fail" > $3
exit 1
EOF
cat > "chain_fail.do" <<'EOF'
#!/bin/sh -e
redo-ifchange fail
EOF
test_expect_success "return nonzero" "
test_must_fail redo fail
"
test_expect_success "return nonzero when dependency failed" "
test_must_fail redo chain_fail
"
test_expect_success "target file was not created" "
test_must_fail test -e fail
"
test_done
|