[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Enable `errexit' shell flag in some test scripts.
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH] Enable `errexit' shell flag in some test scripts. |
Date: |
Sun, 6 Jun 2010 17:05:52 +0200 |
User-agent: |
Mutt/1.5.20 (2009-10-28) |
* Stefano Lattarini wrote on Thu, May 06, 2010 at 01:45:10PM CEST:
> No relevant semantic change should be introduced by the patch, except
> for the test `discover.test', which has been made slighty stricter
> w.r.t. the exit status of Automake (a non-zero exit status is
> expected) and the grepping of the error message produced by Automake.
Let's do this change uniformly. Patch below is for maint.
Cheers,
Ralf
Prefer AUTOMAKE_fails over `$AUTOMAKE | grep' in tests.
* tests/ldadd.test: Enable errexit. Use AUTOMAKE_fails so
the verbose log contains all output.
* tests/mdate.test: Likewise.
Prompted by Stefano Lattarini's change to discover.test.
diff --git a/tests/ldadd.test b/tests/ldadd.test
index 005f9d8..7f4fce8 100755
--- a/tests/ldadd.test
+++ b/tests/ldadd.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 2000, 2001, 2002, 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
@@ -19,6 +20,8 @@
required=libtool
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
@@ -39,5 +42,6 @@ END
: > q.c
$ACLOCAL || Exit 1
-$AUTOMAKE 2>&1 | grep LDADD || Exit 1
+AUTOMAKE_fails
+grep LDADD stderr || Exit 1
Exit 0
diff --git a/tests/mdate.test b/tests/mdate.test
index 704b393..92a736f 100755
--- a/tests/mdate.test
+++ b/tests/mdate.test
@@ -1,5 +1,6 @@
#!/bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 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
@@ -18,6 +19,8 @@
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
END
@@ -31,4 +34,5 @@ END
: > texinfo.tex
$ACLOCAL || Exit 1
-$AUTOMAKE 2>&1 > /dev/null | grep 'required file.*mdate-sh'
+AUTOMAKE_fails
+grep 'required file.*mdate-sh' stderr