[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Minor improvements and fixes in tests `depcomp*.test'.
From: |
Stefano Lattarini |
Subject: |
[PATCH] Minor improvements and fixes in tests `depcomp*.test'. |
Date: |
Tue, 22 Jun 2010 18:48:00 +0200 |
User-agent: |
KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; ) |
Yet another testsuite-tweaking patch.
Regards,
Stefano
-*-*-*-
* tests/depcomp.test: Do not create useless dummy source files.
Add a trailing `:' command.
* tests/depcomp2.test: Use `unset' on the CFLAG variable to ensure
it's not in in the environment, rather than exporting it with an
empty value. Do not pass CC=gcc to configure, as that's already
done in ./defs since we have gcc in $required. Ensure verbose
printing of captured stderr, and normalize its checking. Add a
trailing `:' command.
* tests/depcomp3.test: Quote literal dots and dollar characters in
grep regexps. Always use `: >' rather than `touch' to create empty
files. Explicitly declare phony targets as such in the created
Makefile.am. Add a trailing `:' command.
* tests/depcomp4.test: Quote literal dots and dollar characters in
grep regexp. Explicitly declare phony targets as such in the
created Makefile.am. Ensure verbose printing of captured makes'
stoud/stderr. Add a trailing `:' command.
* tests/depcomp5.test: Move setting of `errexit' shell flag earlier
in the script (just after inclusion of ./defs). Quote literal dots
and dollar characters in grep regexps. Explicitly declare phony
targets as such in the created Makefile.am. Add a trailing `:'
command.
* tests/depcomp6.test: Consistently use m4 quoting in the generated
configure.in. Cosmetic fixes to spacing. Add a useful comment
about an apparently useless use of an `if' statement.
* tests/depcomp7.test: Likewise, and add a trailing `:' command.
---
ChangeLog | 29 +++++++++++++++++++++++++++++
tests/depcomp.test | 5 ++---
tests/depcomp2.test | 9 +++++----
tests/depcomp3.test | 9 ++++++---
tests/depcomp4.test | 9 ++++++---
tests/depcomp5.test | 11 +++++++----
tests/depcomp6.test | 11 ++++++++---
tests/depcomp7.test | 14 +++++++++++---
8 files changed, 74 insertions(+), 23 deletions(-)
From 642a33e308d692b20e8a8238607023b920864858 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Mon, 21 Jun 2010 17:47:28 +0200
Subject: [PATCH] Minor improvements and fixes in tests `depcomp*.test'.
* tests/depcomp.test: Do not create useless dummy source files.
Add a trailing `:' command.
* tests/depcomp2.test: Use `unset' on the CFLAG variable to ensure
it's not in in the environment, rather than exporting it with an
empty value. Do not pass CC=gcc to configure, as that's already
done in ./defs since we have gcc in $required. Ensure verbose
printing of captured stderr, and normalize its checking. Add a
trailing `:' command.
* tests/depcomp3.test: Quote literal dots and dollar characters in
grep regexps. Always use `: >' rather than `touch' to create empty
files. Explicitly declare phony targets as such in the created
Makefile.am. Add a trailing `:' command.
* tests/depcomp4.test: Quote literal dots and dollar characters in
grep regexp. Explicitly declare phony targets as such in the
created Makefile.am. Ensure verbose printing of captured makes'
stoud/stderr. Add a trailing `:' command.
* tests/depcomp5.test: Move setting of `errexit' shell flag earlier
in the script (just after inclusion of ./defs). Quote literal dots
and dollar characters in grep regexps. Explicitly declare phony
targets as such in the created Makefile.am. Add a trailing `:'
command.
* tests/depcomp6.test: Consistently use m4 quoting in the generated
configure.in. Cosmetic fixes to spacing. Add a useful comment
about an apparently useless use of an `if' statement.
* tests/depcomp7.test: Likewise, and add a trailing `:' command.
---
ChangeLog | 29 +++++++++++++++++++++++++++++
tests/depcomp.test | 5 ++---
tests/depcomp2.test | 9 +++++----
tests/depcomp3.test | 9 ++++++---
tests/depcomp4.test | 9 ++++++---
tests/depcomp5.test | 11 +++++++----
tests/depcomp6.test | 11 ++++++++---
tests/depcomp7.test | 14 +++++++++++---
8 files changed, 74 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 469578c..421f4af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2010-06-22 Stefano Lattarini <address@hidden>
+
+ Minor improvements and fixes in tests `depcomp*.test'.
+ * tests/depcomp.test: Do not create useless dummy source files.
+ Add a trailing `:' command.
+ * tests/depcomp2.test: Use `unset' on the CFLAG variable to ensure
+ it's not in in the environment, rather than exporting it with an
+ empty value. Do not pass CC=gcc to configure, as that's already
+ done in ./defs since we have gcc in $required. Ensure verbose
+ printing of captured stderr, and normalize its checking. Add a
+ trailing `:' command.
+ * tests/depcomp3.test: Quote literal dots and dollar characters in
+ grep regexps. Always use `: >' rather than `touch' to create empty
+ files. Explicitly declare phony targets as such in the created
+ Makefile.am. Add a trailing `:' command.
+ * tests/depcomp4.test: Quote literal dots and dollar characters in
+ grep regexp. Explicitly declare phony targets as such in the
+ created Makefile.am. Ensure verbose printing of captured makes'
+ stoud/stderr. Add a trailing `:' command.
+ * tests/depcomp5.test: Move setting of `errexit' shell flag earlier
+ in the script (just after inclusion of ./defs). Quote literal dots
+ and dollar characters in grep regexps. Explicitly declare phony
+ targets as such in the created Makefile.am. Add a trailing `:'
+ command.
+ * tests/depcomp6.test: Consistently use m4 quoting in the generated
+ configure.in. Cosmetic fixes to spacing. Add a useful comment
+ about an apparently useless use of an `if' statement.
+ * tests/depcomp7.test: Likewise, and add a trailing `:' command.
+
2010-06-21 Ralf Wildenhues <address@hidden>
Fix minor testsuite issues, update docs, for Yacc/Lex changes.
diff --git a/tests/depcomp.test b/tests/depcomp.test
index 8b9be29..d5b6c78 100755
--- a/tests/depcomp.test
+++ b/tests/depcomp.test
@@ -40,12 +40,11 @@ END
cp subdir/Makefile.am subdir2/Makefile.am
-: > subdir/foo.c
-: > subdir2/foo.c
-
$ACLOCAL
$AUTOMAKE --add-missing
# There used to be a bug where this was created in the first subdir with C
# sources in it instead of in $top_srcdir or $ac_auxdir
test -f depcomp
+
+:
diff --git a/tests/depcomp2.test b/tests/depcomp2.test
index 2b4353c..29404d6 100755
--- a/tests/depcomp2.test
+++ b/tests/depcomp2.test
@@ -43,11 +43,12 @@ END
: > subdir/foo.c
# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
+unset CFLAGS
$ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
-./configure CC='gcc' 2>error.log
-test -z "`cat error.log`"
+./configure 2>stderr || { cat stderr >&2; Exit 1; }
+test ! -s stderr
+
+:
diff --git a/tests/depcomp3.test b/tests/depcomp3.test
index 2a5db60..513a01d 100755
--- a/tests/depcomp3.test
+++ b/tests/depcomp3.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
@@ -32,14 +32,15 @@ AUTOMAKE_OPTIONS = subdir-objects
check_PROGRAMS = prg
prg_SOURCES = src/sub.c src/foo.h
+.PHONY: grepdeps
grepdeps:
- grep 'src/sub.$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
+ grep 'src/sub\.\$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
END
mkdir src
-touch src/foo.h
+: > src/foo.h
cat >src/sub.c <<EOF
#include "foo.h"
@@ -60,3 +61,5 @@ grep am_cv_CC_dependencies_compiler_type configure
./configure am_cv_CC_dependencies_compiler_type=dashmstdout
$MAKE check
$MAKE grepdeps
+
+:
diff --git a/tests/depcomp4.test b/tests/depcomp4.test
index 7d22894..4f2df97 100755
--- a/tests/depcomp4.test
+++ b/tests/depcomp4.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
@@ -31,8 +31,9 @@ cat > Makefile.am << 'END'
noinst_LTLIBRARIES = liba.la
liba_la_SOURCES = a.c foo.h
+.PHONY: grepdeps
grepdeps:
- grep 'a.lo *:' ./$(DEPDIR)/a.Plo
+ grep 'a\.lo *:' ./$(DEPDIR)/a.Plo
END
: > foo.h
@@ -51,7 +52,9 @@ $AUTOMAKE -a
grep am_cv_CC_dependencies_compiler_type configure
./configure am_cv_CC_dependencies_compiler_type=makedepend
-$MAKE >output 2>&1
+$MAKE >output 2>&1 || { cat output; Exit 1; }
cat output
grep 'unknown directive' output && Exit 1
$MAKE grepdeps
+
+:
diff --git a/tests/depcomp5.test b/tests/depcomp5.test
index 9637288..9a4e1b1 100755
--- a/tests/depcomp5.test
+++ b/tests/depcomp5.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
@@ -19,6 +19,8 @@
required='icc'
. ./defs || Exit 1
+set -e
+
# Automake supports icc since version 7.0 through a dedicated depcomp mode.
# icc 8.0 and greater understand gcc options, so depmode is set to gcc.
if icc -V -help 2>&1 | grep 'Version 7'; then
@@ -27,8 +29,6 @@ else
expect='depmode=gcc'
fi
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
@@ -40,8 +40,9 @@ AUTOMAKE_OPTIONS = subdir-objects
check_PROGRAMS = prg
prg_SOURCES = src/sub.c src/foo.h
+.PHONY: grepdeps
grepdeps:
- grep 'src/sub.$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
+ grep 'src/sub\.\$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
END
@@ -66,3 +67,5 @@ $AUTOMAKE -a
grep "$expect" Makefile
$MAKE check
$MAKE grepdeps
+
+:
diff --git a/tests/depcomp6.test b/tests/depcomp6.test
index 0b6a7f5..da3862c 100755
--- a/tests/depcomp6.test
+++ b/tests/depcomp6.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006, 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
@@ -20,11 +20,11 @@
set -e
-cat >> configure.in << 'END'
+cat >>configure.in <<'END'
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_RANLIB
-AC_CONFIG_FILES(sub2/Makefile)
+AC_CONFIG_FILES([sub2/Makefile])
AC_OUTPUT
END
@@ -94,6 +94,11 @@ else
cd sub2
$sleep
echo 'choke me' > sub3/ba3.h
+ # Do not use `$MAKE && Exit 1' here, since even relatively-recent
+ # versions of the BSD shell wrongly exit when the `errexit' shell
+ # flag is active if a command within "&&" fails inside a compound
+ # statement.
if $MAKE; then Exit 1; fi
fi
+
:
diff --git a/tests/depcomp7.test b/tests/depcomp7.test
index 67702c7..5749280 100755
--- a/tests/depcomp7.test
+++ b/tests/depcomp7.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007, 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
@@ -21,11 +21,11 @@ required='libtoolize'
set -e
-cat >> configure.in << 'END'
+cat >>configure.in<< 'END'
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_LIBTOOL
-AC_CONFIG_FILES(sub2/Makefile)
+AC_CONFIG_FILES([sub2/Makefile])
AC_OUTPUT
END
@@ -88,6 +88,7 @@ $AUTOCONF
$AUTOMAKE -a
for staticshared in --disable-shared "" --disable-static; do
+
./configure --enable-dependency-tracking $staticshared
$MAKE
@@ -97,6 +98,10 @@ for staticshared in --disable-shared "" --disable-static; do
cd sub2
$sleep
echo 'choke me' > sub3/ba3.h
+ # Do not use `$MAKE && Exit 1' here, since even relatively-recent
+ # versions of the BSD shell wrongly exit when the `errexit' shell
+ # flag is active if a command within "&&" fails inside a compound
+ # statement.
if $MAKE; then Exit 1; fi
cd ..
fi
@@ -106,4 +111,7 @@ for staticshared in --disable-shared "" --disable-static; do
test ! -f sub2/sub3/ba3.d
echo 'extern int x;' > sub2/sub3/ba3.h
+
done
+
+:
--
1.6.5
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Minor improvements and fixes in tests `depcomp*.test'.,
Stefano Lattarini <=