[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-921-g5519bd2 |
Date: |
Sat, 11 Jun 2011 10:55:21 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=5519bd2186f0bc635efe8ea14e8459a14459cc27
The branch, testsuite-work has been updated
via 5519bd2186f0bc635efe8ea14e8459a14459cc27 (commit)
via 2ea2717733324ba9bd261167ea10b7252bdf985e (commit)
via a2154d14b618540a8e32f745f0f29ab924de91b2 (commit)
via d295932ed40e46b94fe2ce8932a571ebd1e7dc92 (commit)
from 391f55ae47ddbe43a5fc4524f7ec9bb0d67689c0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5519bd2186f0bc635efe8ea14e8459a14459cc27
Merge: a2154d1 2ea2717
Author: Stefano Lattarini <address@hidden>
Date: Sat Jun 11 12:54:44 2011 +0200
Merge branch 'master' into testsuite-work
commit a2154d14b618540a8e32f745f0f29ab924de91b2
Author: Stefano Lattarini <address@hidden>
Date: Tue Jun 7 16:36:40 2011 +0200
testsuite: use 'fatal_' and 'framework_failure_' for hard errors
* tests/defs (require_xsi): Use `fatal_', not `framework_failure',
to report an invalid usage.
* tests/remake-gnulib-remove-header.test: Prefer using `fatal_'
with a proper error message over a direct call to `Exit 99'.
* tests/pr8365-remake-timing.test: Likewise.
* tests/cygnus-imply-foreign.test: Likewise.
* tests/missing6.test: Likewise.
* tests/cond8.test: Likewise.
* tests/cond33.test: Likewise.
* tests/python-virtualenv.test: Prefer using `framework_failure_'
with a proper error message over a direct call to `Exit 99'.
* tests/instspc-tests.sh: Prefer using `framework_failure_' and
`fatal_' over direct calls to `Exit 99'.
(fatal_): Define this (which is a simplified version of the one
in `tests/defs') for early uses (i.e., before `tests/defs'
gets sourced).
* tests/depmode-tests.sh: Likewise. Also, simplify the
'get_depmodes' function and calls to it accordingly.
commit d295932ed40e46b94fe2ce8932a571ebd1e7dc92
Author: Stefano Lattarini <address@hidden>
Date: Tue Jun 7 16:00:31 2011 +0200
self tests: check new 'fatal_' function
* tests/self-check-exit.test: Also check the new 'fatal_'
function.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 28 ++++++++++++++++++++++++
tests/cond33.test | 2 +-
tests/cond8.test | 2 +-
tests/cygnus-imply-foreign.test | 3 +-
tests/defs | 2 +-
tests/depmod-tests.sh | 35 +++++++++++++++--------------
tests/instspc-tests.sh | 37 ++++++++++++++++---------------
tests/missing6.test | 2 +-
tests/pr8365-remake-timing.test | 3 +-
tests/python-virtualenv.test | 4 ++-
tests/remake-gnulib-remove-header.test | 4 +-
tests/self-check-report.test | 4 +++
12 files changed, 82 insertions(+), 44 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6ada906..a7f9a4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,33 @@
2011-06-08 Stefano Lattarini <address@hidden>
+ testsuite: use 'fatal_' and 'framework_failure_' for hard errors
+ * tests/defs (require_xsi): Use `fatal_', not `framework_failure',
+ to report an invalid usage.
+ * tests/remake-gnulib-remove-header.test: Prefer using `fatal_'
+ with a proper error message over a direct call to `Exit 99'.
+ * tests/pr8365-remake-timing.test: Likewise.
+ * tests/cygnus-imply-foreign.test: Likewise.
+ * tests/missing6.test: Likewise.
+ * tests/cond8.test: Likewise.
+ * tests/cond33.test: Likewise.
+ * tests/python-virtualenv.test: Prefer using `framework_failure_'
+ with a proper error message over a direct call to `Exit 99'.
+ * tests/instspc-tests.sh: Prefer using `framework_failure_' and
+ `fatal_' over direct calls to `Exit 99'.
+ (fatal_): Define this (which is a simplified version of the one
+ in `tests/defs') for early uses (i.e., before `tests/defs'
+ gets sourced).
+ * tests/depmode-tests.sh: Likewise. Also, simplify the
+ 'get_depmodes' function and calls to it accordingly.
+
+2011-06-08 Stefano Lattarini <address@hidden>
+
+ self tests: check new 'fatal_' function
+ * tests/self-check-exit.test: Also check the new 'fatal_'
+ function.
+
+2011-06-08 Stefano Lattarini <address@hidden>
+
test defs: new function 'fatal_', for hard errors
Before this patch, the only way offered by tests/defs to
properly signal a hard error was the `framework_failure_'
diff --git a/tests/cond33.test b/tests/cond33.test
index 126a4c1..149795d 100755
--- a/tests/cond33.test
+++ b/tests/cond33.test
@@ -47,7 +47,7 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 99
+cwd=`pwd` || fatal_ "cannot get current directory"
mkdir nowhere
chmod a-w nowhere
diff --git a/tests/cond8.test b/tests/cond8.test
index 3fe7b5c..07bf2d0 100755
--- a/tests/cond8.test
+++ b/tests/cond8.test
@@ -59,7 +59,7 @@ END
cp x.c y.c
-instdir=`pwd`/_inst || Exit 99
+instdir=`pwd`/_inst || fatal_ "cannot get current directory"
# Skip the rest of the test in case of e.g. missing C compiler.
./configure --prefix="$instdir" x=yes || Exit $?
diff --git a/tests/cygnus-imply-foreign.test b/tests/cygnus-imply-foreign.test
index 9a20f21..1a8d7d3 100755
--- a/tests/cygnus-imply-foreign.test
+++ b/tests/cygnus-imply-foreign.test
@@ -51,7 +51,8 @@ mv -f Makefile.sav Makefile.am
# Try again, this time enabling cygnus mode from configure.in.
cp configure.in configure.sav
sed 's/^AM_INIT_AUTOMAKE$/&([gnits cygnus])/' configure.sav >configure.in
-cmp configure.in configure.sav && Exit 99 # sanity check
+cmp configure.in configure.sav && fatal_ 'failed to edit configure.in'
+
$ACLOCAL --force
$AUTOMAKE -Werror
mv -f configure.sav configure.in
diff --git a/tests/defs b/tests/defs
index b65989a..df62751 100644
--- a/tests/defs
+++ b/tests/defs
@@ -306,7 +306,7 @@ get_shell_script ()
# Skip the test if the given shell fails to support common XSI constructs.
require_xsi ()
{
- test $# -eq 1 || framework_failure_ "require_xsi needs exactly one arg"
+ test $# -eq 1 || fatal_ "require_xsi needs exactly one argument"
echo "$me: trying some XSI constructs with $1"
$1 -c "$xsi_shell_code" || skip_ "$1 lacks XSI features"
}
diff --git a/tests/depmod-tests.sh b/tests/depmod-tests.sh
index 36b5719..a21f618 100755
--- a/tests/depmod-tests.sh
+++ b/tests/depmod-tests.sh
@@ -62,10 +62,14 @@ fi
set -e
+# We need this early. It will be overridden when we source ./defs below,
+# which will offer a more proper implementation.
+fatal_ () { echo "$0: $*" >&2; exit 99; }
+
case $# in
- 0) echo "$0: missing argument" >&2; exit 99;;
+ 0) fatal_ "missing argument";;
1) ;;
- *) echo "$0: too many arguments" >&2; exit 99;;
+ *) fatal_ "too many arguments";;
esac
case $1 in
@@ -77,8 +81,7 @@ case $1 in
depmode=`expr /"$1" : '.*/depcomp-\(.*\)\.depmod'`
;;
*)
- echo "$0: invalid argument '$1'" >&2
- exit 99
+ fatal_ "invalid argument '$1'"
;;
esac
@@ -136,7 +139,7 @@ END
: > success
}
-# Usage: get_depmodes DEPCOMP-FILE PROGRAM-NAME
+# Usage: get_depmodes DEPCOMP-FILE
get_depmodes ()
{
# Keep this in sync with the contents of depend.m4.
@@ -144,10 +147,8 @@ get_depmodes ()
| grep -v '^none$'` \
&& : Turn newlines and tabs into spaces, and strip extra whitespace. \
&& all_depmodes=`echo $all_depmodes` \
- && test -n "$all_depmodes" || {
- echo "$2: failed to extract list of valid depmodes from '$1'" >&2
- exit 99
- }
+ && test -n "$all_depmodes" \
+ || fatal_ "can't extract list of valid depmodes from '$1'"
}
if test x"$action" = x"generate-makefile"; then
@@ -182,8 +183,9 @@ set -e
# the files we need. So remove the other files created by ./defs. And
# check we really are in a temporary `*.dir' directory in the build tree,
# since the last thing we want is to remove some random user files!
-test -f ../defs-static && test -f ../defs || Exit 99
-case `pwd` in *.dir);; *) Exit 99;; esac
+test -f ../defs-static && test -f ../defs \
+ && case `pwd` in *.dir) :;; *) false;; esac \
+ || fatal_ "running from the wrong directory"
rm -f *
if test x"$action" = x"generate-data"; then
@@ -194,18 +196,17 @@ if test x"$action" = x"generate-data"; then
Exit 0
fi
-get_depmodes "$top_testsrcdir/lib/depcomp" "$me"
+get_depmodes "$top_testsrcdir/lib/depcomp"
case " $all_depmodes " in
*" $depmode "*) ;;
- *) echo "$me: invalid depmode '$depmode'" >&2; exit 99;;
+ *) fatal_ "invalid depmode '$depmode'";;
esac
### If we are still here, we have to run a test ...
-test -f ../depmod-data.dir/success || {
- echo "$me: setup by depmod-data.test failed" >&2
- Exit 99
-}
+if test ! -f ../depmod-data.dir/success; then
+ framework_failure_ "depmod-data.test failure"
+fi
../depmod-data.dir/configure am_cv_CC_dependencies_compiler_type=$depmode
diff --git a/tests/instspc-tests.sh b/tests/instspc-tests.sh
index c57efb7..9c6c968 100755
--- a/tests/instspc-tests.sh
+++ b/tests/instspc-tests.sh
@@ -44,11 +44,15 @@ else
fi
set -e
+
+# We need this early. It will be overridden when we source ./defs below,
+# which will offer a more proper implementation.
+fatal_ () { echo "$0: $*" >&2; exit 99; }
case $# in
- 0) echo "$0: missing argument" >&2; exit 99;;
+ 0) fatal_ "missing argument";;
1) ;;
- *) echo "$0: too many arguments" >&2; exit 99;;
+ *) fatal_ "too many arguments";;
esac
case $1 in
@@ -64,8 +68,7 @@ case $1 in
instspc_test_name=`expr /"$1" : '.*/install-\(.*\)\.instspc'`
;;
*)
- echo "$0: invalid argument '$1'" >&2
- exit 99
+ fatal_ "invalid argument '$1'"
;;
esac
@@ -75,7 +78,8 @@ define_problematic_string ()
{
tst=$1
shift
- eval "instspc__$tst=\$1" || exit 99
+ eval "instspc__$tst=\$1" \
+ || fatal_ "define_problematic_string: bad argument: '$tst'"
shift
instspc_names_list="$instspc_names_list $tst"
# Some of the "problematic" characters cannot be used in the name of
@@ -284,8 +288,9 @@ set -e
# the files we need. So remove the other files created by ./defs. And
# check we really are in a temporary `*.dir' directory in the build tree,
# since the last thing we want is to remove some random user files!
-test -f ../defs-static && test -f ../defs || Exit 99
-case `pwd` in *.dir);; *) Exit 99;; esac
+test -f ../defs-static && test -f ../defs \
+ && case `pwd` in *.dir) :;; *) false;; esac \
+ || fatal_ "running from the wrong directory"
rm -f *
if test x"$instspc_action" = x"generate-data"; then
@@ -298,16 +303,13 @@ fi
### If we are still here, we have to run a test ...
-eval "instspc_test_string=\${instspc__$instspc_test_name}" || Exit 99
-if test x"$instspc_test_string" = x; then
- echo "$me: invalid test name: '$instspc_test_name'" >&2
- Exit 99
-fi
+eval "instspc_test_string=\${instspc__$instspc_test_name}" \
+ && test x"$instspc_test_string" != x \
+ || fatal_ "invalid test name: '$instspc_test_name'"
-test -f ../instspc-data.dir/success || {
- echo "$me: setup by instspc-data.test failed" >&2
- Exit 99
-}
+if test ! -f ../instspc-data.dir/success; then
+ framework_failure_ "instspc-data.test failure"
+fi
# Skip if this system doesn't support these characters in file names.
mkdir "./$instspc_test_string" || Exit 77
@@ -323,8 +325,7 @@ case $instspc_action in
relbuilddir=..
;;
*)
- echo "$me: internal error: invalid action '$instspc_action'"
- Exit 99
+ fatal_ "invalid action '$instspc_action'"
;;
esac
diff --git a/tests/missing6.test b/tests/missing6.test
index 2e257f1..b6f1562 100755
--- a/tests/missing6.test
+++ b/tests/missing6.test
@@ -38,7 +38,7 @@ $AUTOMAKE
$MAKE
sed 's/^dnl!! //' < configure.ac > configure.tmp
-cmp configure.ac configure.tmp && Exit 99 # sanity check
+cmp configure.ac configure.tmp && fatal_ 'failed to edit configure.ac'
mv -f configure.tmp configure.ac
$MAKE 2>stderr || { cat stderr >&2; Exit 1; }
diff --git a/tests/pr8365-remake-timing.test b/tests/pr8365-remake-timing.test
index 5dbebc6..f549bf1 100755
--- a/tests/pr8365-remake-timing.test
+++ b/tests/pr8365-remake-timing.test
@@ -42,7 +42,8 @@ $AUTOCONF
./configure
$MAKE Makefile
-$EGREP 'FOOBAR|zardoz' Makefile && Exit 99 # Sanity check.
+# Sanity check.
+$EGREP 'FOOBAR|zardoz' Makefile && fatal_ 'unexpected AC_SUBST in Makefile'
echo 'AC_SUBST([FOOBAR])' >> configure.in
diff --git a/tests/python-virtualenv.test b/tests/python-virtualenv.test
index c36c2b7..5ddd8fb 100755
--- a/tests/python-virtualenv.test
+++ b/tests/python-virtualenv.test
@@ -30,7 +30,9 @@ virtualenv --verbose virtenv && test -f virtenv/bin/activate \
# Activate the virtualenv.
. ./virtenv/bin/activate
# Sanity check.
-test -n "$VIRTUAL_ENV" || Exit 99
+if test -z "$VIRTUAL_ENV"; then
+ framework_failure_ "can't activate python virtual environment"
+fi
cwd=`pwd`
py_version=`python -c 'import sys; print("%u.%u" %
tuple(sys.version_info[:2]))'`
diff --git a/tests/remake-gnulib-remove-header.test
b/tests/remake-gnulib-remove-header.test
index de5a2fa..9e9b4e2 100755
--- a/tests/remake-gnulib-remove-header.test
+++ b/tests/remake-gnulib-remove-header.test
@@ -108,7 +108,7 @@ for vpath in : false; do
$sleep
sed -e 's/^\( *override_stdio\)=.*$/\1=false/' $srcdir/macros.m4 > t
- diff $srcdir/macros.m4 t && Exit 99 # sanity check
+ diff $srcdir/macros.m4 t && fatal_ "failed to edit macros.m4"
mv -f t $srcdir/macros.m4
using_gmake || $MAKE Makefile
@@ -120,7 +120,7 @@ for vpath in : false; do
$sleep
sed -e 's/^\( *override_stdio\)=.*$/\1=:/' $srcdir/macros.m4 > t
- diff $srcdir/macros.m4 t && Exit 99 # sanity check
+ diff $srcdir/macros.m4 t && fatal_ "failed to edit macros.m4"
mv -f t $srcdir/macros.m4
using_gmake || $MAKE Makefile
diff --git a/tests/self-check-report.test b/tests/self-check-report.test
index e04c88e..5434d5a 100755
--- a/tests/self-check-report.test
+++ b/tests/self-check-report.test
@@ -31,6 +31,8 @@ exec 5>&1
(fail_ foo) 2>&1 1>&5 | grep "^$me: failed test: foo" || Exit 1
(skip_ foo); test $? -eq 77 || Exit 1
(skip_ foo) 2>&1 1>&5 | grep "^$me: skipped test: foo" || Exit 1
+(fatal_ foo); test $? -eq 99 || Exit 1
+(fatal_ foo) 2>&1 1>&5 | grep "^$me: hard error: foo" || Exit 1
(framework_failure_ foo); test $? -eq 99 || Exit 1
(framework_failure_ foo) 2>&1 1>&5 \
| grep "^$me: set-up failure: foo" || Exit 1
@@ -42,6 +44,8 @@ stderr_fileno_=6
(fail_ foo) 6>&1 1>&5 | grep "^$me: failed test: foo" || Exit 1
(skip_ foo); test $? -eq 77 || Exit 1
(skip_ foo) 6>&1 1>&5 | grep "^$me: skipped test: foo" || Exit 1
+(fatal_ foo); test $? -eq 99 || Exit 1
+(fatal_ foo) 6>&1 1>&5 | grep "^$me: hard error: foo" || Exit 1
(framework_failure_ foo); test $? -eq 99 || Exit 1
(framework_failure_ foo) 6>&1 1>&5 \
| grep "^$me: set-up failure: foo" || Exit 1
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-921-g5519bd2,
Stefano Lattarini <=