[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Extend tests on `nostdinc' automake option.
From: |
Stefano Lattarini |
Subject: |
Re: [PATCH] Extend tests on `nostdinc' automake option. |
Date: |
Mon, 26 Apr 2010 21:41:06 +0200 |
User-agent: |
KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; ) |
At Monday 26 April 2010, Ralf Wildenhues <address@hidden>
wrote:
> Hello Stefano,
>
> * Stefano Lattarini wrote on Mon, Apr 26, 2010 at 02:05:19PM CEST:
> > Extend tests on `nostdinc' automake option.
> >
> > * tests/nostdinc.test: Make the grepping of the generated
> > Makefile.in slighty stricter. Enable `errexit' shell flag.
> > Related and unrelated minor changes.
> > Also, updated copyright years.
> > * tests/nostdinc2.test: New test.
> > * tests/Makefile.am (TESTS): Extended accordingly.
> >
> > @@ -18,9 +18,9 @@
> >
> > . ./defs || Exit 1
> >
> > -cat >> configure.in << 'END'
> > -AC_PROG_CC
> > -END
> > +set -e
> > +
> > +echo AC_PROG_CC >> configure.in
>
> In the future, please don't change these kinds of things
> gratuitously. Same rationale as trailing ':': using a
> here-document allows straight-forward way to extend the text
> later.
This is a valid objection, which I didn't think of (again). I just
didn't (and don't) like the visual clutter imposed by a one-line
here-doc, but given your rationale I'll keep at bay my itchy
fingers :-)
> Also, there is generally no need to mention updated copyright years
> in the ChangeLog entry unless that is the only change you do
> (e.g., because it was forgotten).
I'll be happy to oblige!
> This kind of change is expected. Same reason we don't mention
> regenerated Makefile.in files. Note some other FSF projects do this
> differently (notably GCC and binutils).
>
> Since with your patch, nostdinc.test is a strict subset of
> nostdinc2.test,
Not exactly, as one grep the Makefile.in, the other one the Makefile
generated by configure. Anyway...
> why not merge nostdinc2.test into nostdinc.test?
.. they can be easily merged, which is probably the best choice.
That is done in the attached patch (with a couple of additional
tweakings/extensions).
> Our testsuite is slow as it is already.
>
> Thanks for all your work on the testsuite,
> Ralf
>
Thanks for the review; I hope this second attempt is better.
Regards,
Stefano
From 5a46d305696e5e6a21075f0b51d3d3e1eb0a5e6b Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Mon, 26 Apr 2010 13:58:25 +0200
Subject: [PATCH] Extend test on `nostdinc' automake option.
* tests/nostdinc.test: Enable `errexit' shell flag. Related and
unrelated minor changes. Make the grepping of the generated
Makefile.in slighty stricter. Generate and run configure, so that
the generated Makefile can be grepped too.
---
ChangeLog | 8 ++++++++
tests/nostdinc.test | 26 ++++++++++++++++++++++----
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 71b0d9b..41773e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-04-26 Stefano Lattarini <address@hidden>
+
+ Extend test on `nostdinc' automake option.
+ * tests/nostdinc.test: Enable `errexit' shell flag. Related and
+ unrelated minor changes. Make the grepping of the generated
+ Makefile.in slighty stricter. Generate and run configure, so that
+ the generated Makefile can be grepped too.
+
2010-04-25 Ralf Wildenhues <address@hidden>
Warning and error message formatting cleanups.
diff --git a/tests/nostdinc.test b/tests/nostdinc.test
index 96e30c5..0f6fc76 100755
--- a/tests/nostdinc.test
+++ b/tests/nostdinc.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 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,8 +18,11 @@
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
+AC_OUTPUT
END
cat > Makefile.am << 'END'
@@ -28,8 +31,23 @@ bin_PROGRAMS = foo
foo_SOURCES = foo.c
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '.*-I *\.' Makefile.in && Exit 1
+
+# We'll test the fully-processed Makefile too.
+$AUTOCONF
+
+# Test with $builddir != $srcdir
+mkdir build
+cd build
+../configure
+$EGREP '.*-I *(\.|\$.srcdir.)' Makefile && Exit 1
+
+# Test with $builddir == $srcdir
+cd ..
+./configure
+$EGREP '.*-I *(\.|\$.srcdir.)' Makefile && Exit 1
-$FGREP -e '-I.' Makefile.in && Exit 1
Exit 0
--
1.6.5