[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/3] Enable `errexit' a.k.a. `set -e' shell flag in all test
From: |
Stefano Lattarini |
Subject: |
Re: [PATCH 0/3] Enable `errexit' a.k.a. `set -e' shell flag in all test scripts. |
Date: |
Thu, 8 Apr 2010 16:42:35 +0200 |
User-agent: |
KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.2; i686; ; ) |
Oops, I forgot to bump the copyright years in the modified test.
An updated patch is attached, which also slighty improves the
considerations about the "safety" of the introduction of `set -e'.
Regards,
Stefano
From 77a78ced3805392d4a80cd5896f8e5f9d37f7331 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Thu, 8 Apr 2010 10:54:16 +0200
Subject: [PATCH 1/2] Make test `aclocal3.test' stricter.
* tests/aclocal3.test: Fail if $ACLOCAL succeds unexpectedly.
Bumped copyright years.
---
ChangeLog | 6 ++++++
tests/aclocal3.test | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a5b5426..503b19f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-08 Stefano Lattarini <address@hidden>
+
+ Make test `aclocal3.test' stricter.
+ * tests/aclocal3.test: Fail if $ACLOCAL succeds unexpectedly.
+ Bumped copyright years.
+
2010-04-04 Stefano Lattarini <address@hidden>
Generated tests are now just a thin layer around other tests.
diff --git a/tests/aclocal3.test b/tests/aclocal3.test
index a550e50..9a72819 100755
--- a/tests/aclocal3.test
+++ b/tests/aclocal3.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2002, 2004, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,6 +27,6 @@ AC_DEFUN([GNOME_X_CHECKS], [
])
END
-$ACLOCAL -I macros 2>stderr
+$ACLOCAL -I macros 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr
grep 'macros/gnome.m4:2:.*AM_PATH_GTK.*not found' stderr
--
1.6.5
From 6fc3b0b075b8bba13cc4d19d21d681fd3a57dbdd Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Thu, 8 Apr 2010 10:54:53 +0200
Subject: [PATCH 2/2] Use `set -e' in test aclocal3.test.
* tests/aclocal3.test: Add call to `set -e'.
No portability problems should be introduced, since the test script
uses only simple commands (no command substitution, no compound
command, no shell function).
The only potentially problematic construct is:
$ACLOCAL -I macros 2>stderr && { cat stderr; Exit 1; }
but similar constructs are already used in various other tests, e.g.
in `aclocal.test':
$ACLOCAL --output 2>stderr && { cat stderr >&2; Exit 1; }
$ACLOCAL --unknown-option 2>stderr && { cat stderr >&2; Exit 1; }
...
in `check4.test' and `check8.test':
$MAKE check >stdout && { cat stdout; Exit 1; }
...
etc.
---
ChangeLog | 3 +++
tests/aclocal3.test | 2 ++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 503b19f..6aaf124 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2010-04-08 Stefano Lattarini <address@hidden>
+ Use `set -e' in test aclocal3.test.
+ * tests/aclocal3.test: Add call to `set -e'.
+
Make test `aclocal3.test' stricter.
* tests/aclocal3.test: Fail if $ACLOCAL succeds unexpectedly.
Bumped copyright years.
diff --git a/tests/aclocal3.test b/tests/aclocal3.test
index 9a72819..a6aee0f 100755
--- a/tests/aclocal3.test
+++ b/tests/aclocal3.test
@@ -17,6 +17,8 @@
# Test to make sure include of include detects missing macros
. ./defs || Exit 1
+set -e
+
echo GNOME_X_CHECKS >> configure.in
mkdir macros
--
1.6.5