[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Improvements and extend tests on canonicalization.
From: |
Stefano Lattarini |
Subject: |
[PATCH] Improvements and extend tests on canonicalization. |
Date: |
Fri, 10 Sep 2010 16:43:27 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
The new attached patch is better, and also slighty increase coverage.
Regards,
Stefano
-*-*-
Improvements and extend tests on canonicalization.
* tests/canon-name.test: Add trailing `:' command.
* tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
* tests/canon4.test: Likewise. Make grepping of Makefile.in
stricter. 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 | 18 ++++++++++
tests/Makefile.am | 3 ++
tests/Makefile.in | 3 ++
tests/canon-name.test | 2 +
tests/canon.test | 12 +++++--
tests/canon3.test | 3 +-
tests/canon4.test | 6 ++-
tests/canon5.test | 9 ++++-
tests/canon6.test | 42 ++++++++++++++++++++++
tests/canon7.test | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
tests/canon8.test | 39 +++++++++++++++++++++
11 files changed, 220 insertions(+), 8 deletions(-)
create mode 100755 tests/canon6.test
create mode 100755 tests/canon7.test
create mode 100755 tests/canon8.test
From 194cca454436be29f36957a10939dbc36e3d014b Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Mon, 28 Jun 2010 12:40:55 +0200
Subject: [PATCH] Improvements and extend tests on canonicalization.
* tests/canon-name.test: Add trailing `:' command.
* tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
* tests/canon4.test: Likewise. Make grepping of Makefile.in
stricter. 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 | 18 ++++++++++
tests/Makefile.am | 3 ++
tests/Makefile.in | 3 ++
tests/canon-name.test | 2 +
tests/canon.test | 12 +++++--
tests/canon3.test | 3 +-
tests/canon4.test | 6 ++-
tests/canon5.test | 9 ++++-
tests/canon6.test | 42 ++++++++++++++++++++++
tests/canon7.test | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
tests/canon8.test | 39 +++++++++++++++++++++
11 files changed, 220 insertions(+), 8 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 2334c5c..297e8aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-10 Stefano Lattarini <address@hidden>
+
+ Improvements and extend tests on canonicalization.
+ * tests/canon-name.test: Add trailing `:' command.
+ * tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
+ * tests/canon4.test: Likewise. Make grepping of Makefile.in
+ stricter. 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-09-08 Stefano Lattarini <address@hidden>
Do not require "gzip" explicitly in tests.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 58103cc..0852b6f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -117,6 +117,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 e967caa..06ba221 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -355,6 +355,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..af5d5a7 100755
--- a/tests/canon-name.test
+++ b/tests/canon-name.test
@@ -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..efea841 100755
--- a/tests/canon4.test
+++ b/tests/canon4.test
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test to make sure name canonicalization happens for 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..7aace98
--- /dev/null
+++ b/tests/canon7.test
@@ -0,0 +1,91 @@
+#! /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.
+
+#FIXME: any working C and C++ Compiler should be ok
+required='libtool libtoolize gcc'
+. ./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 # for debugging
+ ./,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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Improvements and extend tests on canonicalization.,
Stefano Lattarini <=