[cairo-commit] 2 commits - cairo-version.h test/make-cairo-test-constructors.sh test/Makefile.am

Bryce Harrington bryce at kemper.freedesktop.org
Fri Mar 13 13:19:34 PDT 2015


 cairo-version.h                      |    2 +-
 test/Makefile.am                     |    2 +-
 test/make-cairo-test-constructors.sh |    4 +++-
 3 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit b19b06c46318e2fe80e2c36175075d11bf4a04ee
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Mar 12 17:02:02 2015 +0100

    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 at osg.samsung.com>

diff --git a/test/Makefile.am b/test/Makefile.am
index 950629b..b2fcd27 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -81,7 +81,7 @@ noinst_SCRIPTS = check-refs.sh
 TESTS += cairo-test-suite$(EXEEXT)
 
 cairo-test-constructors.c: Makefile $(test_sources) make-cairo-test-constructors.sh
-	(cd $(srcdir) && sh ./make-cairo-test-constructors.sh $(test_sources)) > $@
+	(cd $(srcdir) && sh ./make-cairo-test-constructors.sh $(test_sources)) > $@ || (rm $@ ; exit 1)
 
 cairo_test_suite_SOURCES = 		\
 	$(cairo_test_suite_sources)	\
diff --git a/test/make-cairo-test-constructors.sh b/test/make-cairo-test-constructors.sh
index cb1391e..a03d61c 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
commit ec0153940d694c71324ed0d9cf895ac49ed19674
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Fri Mar 13 13:17:28 2015 -0700

    Start 1.14.3 development

diff --git a/cairo-version.h b/cairo-version.h
index 516999e..31168dd 100644
--- a/cairo-version.h
+++ b/cairo-version.h
@@ -3,6 +3,6 @@
 
 #define CAIRO_VERSION_MAJOR 1
 #define CAIRO_VERSION_MINOR 14
-#define CAIRO_VERSION_MICRO 2
+#define CAIRO_VERSION_MICRO 3
 
 #endif


More information about the cairo-commit mailing list