summaryrefslogtreecommitdiff
path: root/test/make-cairo-test-constructors.sh
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2015-03-12 17:02:02 +0100
committerBryce Harrington <bryce@osg.samsung.com>2015-03-13 13:18:32 -0700
commitb19b06c46318e2fe80e2c36175075d11bf4a04ee (patch)
treeea8ceda749338c6aa09b8145cc038dea2bbb8cc6 /test/make-cairo-test-constructors.sh
parentec0153940d694c71324ed0d9cf895ac49ed19674 (diff)
downloadcairo-b19b06c46318e2fe80e2c36175075d11bf4a04ee.tar.gz
Harden make-cairo-test-constructors.sh
The make-cairo-test-constructors.sh script executes several commands without checking their success. This can lead to undetected errors, like those fixed in 86fad78fcd2bf987249890aea4eabcce02a58f45. The script now exits with an error status if no file is input. Moreover, it sets the '-e' flag, so that if a command fails, the whole script is immediately terminated with an error. In the Makefile.am, the script result is now checked and the target file is removed upon error. This ensures that the 'cairo-test-constructors.c' target completes succesfully only if no error occurred. Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'test/make-cairo-test-constructors.sh')
-rw-r--r--test/make-cairo-test-constructors.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/make-cairo-test-constructors.sh b/test/make-cairo-test-constructors.sh
index cb1391e73..a03d61c19 100644
--- a/test/make-cairo-test-constructors.sh
+++ b/test/make-cairo-test-constructors.sh
@@ -1,8 +1,10 @@
#! /bin/sh
+set -e
+
if test $# -eq 0; then
echo "$0: no input files." >&2
- exit 0
+ exit 1
fi
cat <<HERE