automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Improvements and extend tests on canonicalization.


From: Stefano Lattarini
Subject: Re: [PATCH] Improvements and extend tests on canonicalization.
Date: Sat, 11 Dec 2010 18:41:46 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Ping on this? Reference:
 <http://lists.gnu.org/archive/html/automake-patches/2010-09/msg00106.html>

The updated patch is attached.  I will push it in 72 hours (by tuesday
evening) unless there are objections.

In the meantime, I've made some minor improvements and fixings to the
patch; here is what I've squashed in:

-*-*-*-

diff --git a/ChangeLog b/ChangeLog
index 3505197..f00ad5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,12 @@
-2010-09-10  Stefano Lattarini  <address@hidden>
+2010-12-11  Stefano Lattarini  <address@hidden>
 
        Improve and extend tests on canonicalization.
-       * tests/canon-name.test: Add trailing `:' command.
+       * tests/canon-name.test: Add trailing `:' command.  When writing
+       configure.in, prefer to use $me instead of hard-coding the test
+       name.
        * tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
        * tests/canon4.test: Likewise.  Make grepping of Makefile.in
-       stricter.  Add reference to ...
+       stricter.  Improve heading comment, and add reference to ...
        * tests/canon6.test: ... this new test (sister test of the
        previous one).
        * tests/canon.test: Prefer cat + here-doc over echo to append
diff --git a/tests/canon-name.test b/tests/canon-name.test
index af5d5a7..b8e5331 100755
--- a/tests/canon-name.test
+++ b/tests/canon-name.test
@@ -21,8 +21,8 @@
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([canon-name], [1.0])
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([./gmakefile ./sub/gmakefile])
 AC_OUTPUT
diff --git a/tests/canon4.test b/tests/canon4.test
index efea841..454b4ef 100755
--- a/tests/canon4.test
+++ b/tests/canon4.test
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure name canonicalization happens for libraries.
+# Test to make sure name canonicalization happens for static libraries.
 # Keep this in sync with sister test `canon6.test'.
 
 . ./defs || Exit 1
diff --git a/tests/canon7.test b/tests/canon7.test
index 7aace98..9b3d8d0 100755
--- a/tests/canon7.test
+++ b/tests/canon7.test
@@ -16,8 +16,7 @@
 
 # Stress test on canonicalization.
 
-#FIXME: any working C and C++ Compiler should be ok
-required='libtool libtoolize gcc'
+required='libtool libtoolize'
 . ./defs || Exit 1
 
 set -e
@@ -49,7 +48,10 @@ libb_az_baz_a_SOURCES = libs.c
 lib_zardoz___la_SOURCES = libd.c
 
 check-local:
-       ls -l # for debugging
+       ls -l
+       ./,foo-bar
+       ./dummy_static
+       ./dummy_dynamic
        ./,foo-bar | grep 'Hello, FooBar!'
        ./dummy_static | grep 'Hello from Static!'
        ./dummy_dynamic | grep 'Hello from Dynamic!'

-*-*-*-

Regards,
  Stefano
From 0ebb64413d1dfc5fc783720c95344910d20c342b Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Mon, 28 Jun 2010 12:40:55 +0200
Subject: [PATCH] Improve and extend tests on canonicalization.

* tests/canon-name.test: Add trailing `:' command.  When writing
configure.in, prefer to use $me instead of hard-coding the test
name.
* tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
* tests/canon4.test: Likewise.  Make grepping of Makefile.in
stricter.  Improve heading comment, and add reference to ...
* tests/canon6.test: ... this new test (sister test of the
previous one).
* tests/canon.test: Prefer cat + here-doc over echo to append
text to configure.in.  Extend grepping of Automake stderr.  Add
trailing `:' command.
* tests/canon5.test: Likewise.
* tests/canon7.test: New file, stress test on canonicalization.
* tests/canon8.test: New test, for better coverage (check that
the `@' character is not transliterated in canonicalizations).
* tests/Makefile.am: Updated.
---
 ChangeLog             |   20 ++++++++++
 tests/Makefile.am     |    3 ++
 tests/Makefile.in     |    3 ++
 tests/canon-name.test |    6 ++-
 tests/canon.test      |   12 +++++--
 tests/canon3.test     |    3 +-
 tests/canon4.test     |    8 +++--
 tests/canon5.test     |    9 ++++-
 tests/canon6.test     |   42 ++++++++++++++++++++++
 tests/canon7.test     |   93 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/canon8.test     |   39 ++++++++++++++++++++
 11 files changed, 227 insertions(+), 11 deletions(-)
 create mode 100755 tests/canon6.test
 create mode 100755 tests/canon7.test
 create mode 100755 tests/canon8.test

diff --git a/ChangeLog b/ChangeLog
index 5afdc53..5717b21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2010-12-11  Stefano Lattarini  <address@hidden>
+
+       Improve and extend tests on canonicalization.
+       * tests/canon-name.test: Add trailing `:' command.  When writing
+       configure.in, prefer to use $me instead of hard-coding the test
+       name.
+       * tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
+       * tests/canon4.test: Likewise.  Make grepping of Makefile.in
+       stricter.  Improve heading comment, and add reference to ...
+       * tests/canon6.test: ... this new test (sister test of the
+       previous one).
+       * tests/canon.test: Prefer cat + here-doc over echo to append
+       text to configure.in.  Extend grepping of Automake stderr.  Add
+       trailing `:' command.
+       * tests/canon5.test: Likewise.
+       * tests/canon7.test: New file, stress test on canonicalization.
+       * tests/canon8.test: New test, for better coverage (check that
+       the `@' character is not transliterated in canonicalizations).
+       * tests/Makefile.am: Updated.
+
 2010-12-10  Ralf Wildenhues  <address@hidden>
 
        Avoid running installed automake from 'libtool --help'.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dab04e3..1871512 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -118,6 +118,9 @@ canon2.test \
 canon3.test \
 canon4.test \
 canon5.test \
+canon6.test \
+canon7.test \
+canon8.test \
 canon-name.test \
 ccnoco.test \
 ccnoco2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index de21f43..f8ca8f8 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -385,6 +385,9 @@ canon2.test \
 canon3.test \
 canon4.test \
 canon5.test \
+canon6.test \
+canon7.test \
+canon8.test \
 canon-name.test \
 ccnoco.test \
 ccnoco2.test \
diff --git a/tests/canon-name.test b/tests/canon-name.test
index aecda17..b8e5331 100755
--- a/tests/canon-name.test
+++ b/tests/canon-name.test
@@ -21,8 +21,8 @@
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([canon-name], [1.0])
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([./gmakefile ./sub/gmakefile])
 AC_OUTPUT
@@ -36,3 +36,5 @@ $ACLOCAL
 AUTOMAKE_fails
 grep 'leading.*\./.*\./gmakefile' stderr
 grep 'leading.*\./.*\./sub/gmakefile' stderr
+
+:
diff --git a/tests/canon.test b/tests/canon.test
index 2b035d0..fc524fd 100755
--- a/tests/canon.test
+++ b/tests/canon.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 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
@@ -20,7 +21,9 @@
 
 set -e
 
-echo AC_PROG_CC >> configure.in
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = sniff-glue
@@ -29,4 +32,7 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:2:.*sniff_glue_SOURCES' stderr
+grep 'Makefile\.am:2:.* bad .*variable.*sniff-glue_SOURCES' stderr
+grep 'Makefile\.am:2:.* use .*sniff_glue_SOURCES' stderr
+
+:
diff --git a/tests/canon3.test b/tests/canon3.test
index 9d5a172..ce5876a 100755
--- a/tests/canon3.test
+++ b/tests/canon3.test
@@ -34,4 +34,5 @@ $ACLOCAL
 $AUTOMAKE
 
 $FGREP 'perm_number.c' Makefile.in && Exit 1
-Exit 0
+
+:
diff --git a/tests/canon4.test b/tests/canon4.test
index 52e968d..454b4ef 100755
--- a/tests/canon4.test
+++ b/tests/canon4.test
@@ -14,7 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure name canonicalization happens for libraries.
+# Test to make sure name canonicalization happens for static libraries.
+# Keep this in sync with sister test `canon6.test'.
 
 . ./defs || Exit 1
 
@@ -33,5 +34,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '^libx-y.*=' Makefile.in && Exit 1
-Exit 0
+grep '^ *libx-y.*=' Makefile.in && Exit 1
+
+:
diff --git a/tests/canon5.test b/tests/canon5.test
index 53cdeb2..3bd99ab 100755
--- a/tests/canon5.test
+++ b/tests/canon5.test
@@ -22,7 +22,9 @@
 
 set -e
 
-echo AC_PROG_CC >> configure.in
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
 
 $ACLOCAL
 
@@ -46,7 +48,8 @@ bin_PROGRAMS = ,foo
 END
 
 AUTOMAKE_fails
-grep 'Makefile.am:2:.*_foo_SOURCES' stderr
+grep 'Makefile\.am:2:.* bad .*variable.*,foo_SOURCES' stderr
+grep 'Makefile\.am:2:.* use .*_foo_SOURCES' stderr
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = ,foo
@@ -54,3 +57,5 @@ _foo_SOURCES = foo.c
 END
 
 $AUTOMAKE -Wno-portability
+
+:
diff --git a/tests/canon6.test b/tests/canon6.test
new file mode 100755
index 0000000..d103996
--- /dev/null
+++ b/tests/canon6.test
@@ -0,0 +1,42 @@
+#! /bin/sh
+# Copyright (C) 1996, 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test to make sure name canonicalization happens for libtool libraries.
+# Keep this in sync with sister test `canon4.test'.
+
+required='libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+END
+
+cat > Makefile.am << 'END'
+noinst_LTLIBRARIES = libx-y.la
+libx_y_la_SOURCES = xy.c
+END
+
+: > ltmain.sh
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '^ *libx-y.*=' Makefile.in && Exit 1
+
+:
diff --git a/tests/canon7.test b/tests/canon7.test
new file mode 100755
index 0000000..9b3d8d0
--- /dev/null
+++ b/tests/canon7.test
@@ -0,0 +1,93 @@
+#! /bin/sh
+# Copyright (C) 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Stress test on canonicalization.
+
+required='libtool libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_RANLIB  dnl: for static libraries
+AC_PROG_LIBTOOL dnl: for libtool libraries
+AC_OUTPUT
+END
+
+touch ,foo-bar libb.az+baz lib~zardoz,, || Exit 77
+rm -f ,foo-bar libb.az+baz lib~zardoz,,
+
+cat > Makefile.am << 'END'
+noinst_PROGRAMS = dummy_static dummy_dynamic ,foo-bar
+noinst_LIBRARIES = libb.az+baz.a
+noinst_LTLIBRARIES = lib~zardoz,,.la
+
+dummy_static_SOURCES = dummy.c lib.h
+dummy_dynamic_SOURCES = $(dummy_static_SOURCES)
+
+dummy_static_LDADD = $(noinst_LIBRARIES)
+dummy_dynamic_LDADD = $(noinst_LTLIBRARIES)
+
+_foo_bar_SOURCES = libs.c
+libb_az_baz_a_SOURCES = libs.c
+lib_zardoz___la_SOURCES = libd.c
+
+check-local:
+       ls -l
+       ./,foo-bar
+       ./dummy_static
+       ./dummy_dynamic
+       ./,foo-bar | grep 'Hello, FooBar!'
+       ./dummy_static | grep 'Hello from Static!'
+       ./dummy_dynamic | grep 'Hello from Dynamic!'
+END
+
+cat > foobar.c << 'END'
+#include <stdio.h>
+int main(void)
+{
+  printf("Hello, FooBar!\n");
+  return 0;
+}
+END
+
+cat > dummy.c << 'END'
+#include <stdio.h>
+#include "lib.h"
+int main(void)
+{
+  printf("Hello from %s!\n", dummy_func());
+  return 0;
+}
+END
+
+echo 'char *dummy_func(void);' > lib.h
+echo 'char *dummy_func(void) { return "Dynamic"; }' > libd.c
+echo 'char *dummy_func(void) { return "Static"; }' > libs.c
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
diff --git a/tests/canon8.test b/tests/canon8.test
new file mode 100755
index 0000000..0bd3bf8
--- /dev/null
+++ b/tests/canon8.test
@@ -0,0 +1,39 @@
+#! /bin/sh
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that canonicalization does not transliterate the `@' charactrer.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = address@hidden
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+grep foob.rquux Makefile.in # might be useful for debugging
+grep address@hidden Makefile.in # `@' must not be transliterated ...
+grep 'address@hidden' Makefile.in && Exit 1 # ... ever!
+
+:
-- 
1.7.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]