Add tests about support of wildcards in EXTRA_DIST.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 20 Feb 2010 16:38:19 +0000 (17:38 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 20 Feb 2010 16:38:19 +0000 (17:38 +0100)
* tests/extra10.test: New test, check basic support of wildcards
in EXTRA_DIST.
* tests/extra11.test: New test, check more complex usage of
wildcards in EXTRA_DIST.
* tests/extra11.test: New test, check usage of wildcards in
EXTRA_DIST when $builddir != $srcdir.
* tests/Makefile.am (TESTS): Updated accordingly.
Necessity of these new tests suggested by Braden McDaniel
and Ralf Wildenhues.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/extra10.test [new file with mode: 0755]
tests/extra11.test [new file with mode: 0755]
tests/extra12.test [new file with mode: 0755]

index 66858c1..1729fea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-20  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Add tests about support of wildcards in EXTRA_DIST.
+       * tests/extra10.test: New test, check basic support of wildcards
+       in EXTRA_DIST.
+       * tests/extra11.test: New test, check more complex usage of
+       wildcards in EXTRA_DIST.
+       * tests/extra11.test: New test, check usage of wildcards in
+       EXTRA_DIST when $builddir != $srcdir.
+       * tests/Makefile.am (TESTS): Updated accordingly.
+       Necessity of these new tests suggested by Braden McDaniel
+       and Ralf Wildenhues.
+
 2010-02-08  Simon Josefsson  <simon@josefsson.org>
 
        Fix copyright statement in gnupload script.
index c160028..4b73a62 100644 (file)
@@ -306,6 +306,9 @@ extra5.test \
 extra6.test \
 extra7.test \
 extra8.test \
+extra10.test \
+extra11.test \
+extra12.test \
 f90only.test \
 flavor.test \
 flibs.test \
index 3d74046..709739e 100644 (file)
@@ -541,6 +541,9 @@ extra5.test \
 extra6.test \
 extra7.test \
 extra8.test \
+extra10.test \
+extra11.test \
+extra12.test \
 f90only.test \
 flavor.test \
 flibs.test \
diff --git a/tests/extra10.test b/tests/extra10.test
new file mode 100755 (executable)
index 0000000..16d06a3
--- /dev/null
@@ -0,0 +1,43 @@
+#! /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/>.
+
+# Check that wildcards in EXTRA_DIST are honoured.
+# Suggested by observations from Braden McDaniel.
+
+. ./defs || Exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am <<'END'
+EXTRA_DIST=*.foo
+.PHONY: test
+test: distdir
+       diff a.foo $(distdir)/a.foo
+       diff b.foo $(distdir)/b.foo
+       test ! -r $(distdir)/c.bar
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+echo aaa > a.foo
+echo bbb > b.foo
+echo ccc > c.foo
+./configure
+$MAKE test
diff --git a/tests/extra11.test b/tests/extra11.test
new file mode 100755 (executable)
index 0000000..14dda42
--- /dev/null
@@ -0,0 +1,72 @@
+#! /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/>.
+
+# Check for more complex usage of wildcards in EXTRA_DIST.
+# Suggested by observations from Braden McDaniel.
+
+. ./defs || Exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am <<'END'
+EXTRA_DIST = [!c-z].t d.t [ab].dir foo.* *zardoz*
+
+.PHONY: prereq
+prereq:
+       echo a > a.t
+       echo b > b.t
+       echo c > c.t
+       echo d > d.t
+       echo m > m.t
+       echo z > z.t
+       mkdir a.dir b.dir c.dir
+       echo a1 > a.dir/f1
+       echo a2 > a.dir/f2
+       echo bb > b.dir/f
+       echo cc > c.dir/x
+       echo 0 > foo
+       echo 1 > foo.x
+       echo 2 > foo.bar
+       echo foo > _zardoz_
+
+.PHONY: test
+test: distdir
+       diff a.t $(distdir)/a.t
+       diff b.t $(distdir)/b.t
+       test ! -r $(distdir)/c.t
+       diff d.t $(distdir)/d.t
+       test ! -r $(distdir)/m.t
+       test ! -r $(distdir)/z.t
+       diff a.dir/f1 $(distdir)/a.dir/f1
+       diff a.dir/f2 $(distdir)/a.dir/f2
+       diff b.dir/f $(distdir)/b.dir/f
+       test ! -r $(distdir)/c.dir
+       diff foo.x $(distdir)/foo.x
+       diff foo.bar $(distdir)/foo.bar
+       test ! -r $(distdir)/foo
+       diff _zardoz_ $(distdir)/_zardoz_
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+$MAKE prereq
+ls -l . *.dir
+$MAKE test
diff --git a/tests/extra12.test b/tests/extra12.test
new file mode 100755 (executable)
index 0000000..72b918c
--- /dev/null
@@ -0,0 +1,52 @@
+#! /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/>.
+
+# Check that wildcards in elements of EXTRA_DIST are honoured when
+# $srcdir != $builddir, if properly declared.
+# Suggested by observations from Braden McDaniel.
+
+. ./defs || Exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+
+cat > Makefile.am <<'END'
+EXTRA_DIST = *.foo $(srcdir)/*.foo $(builddir)/*.bar $(srcdir)/*.bar
+
+.PHONY: test
+test: distdir
+       ls -l $(srcdir) $(builddir) $(distdir)
+       diff $(srcdir)/a.foo $(distdir)/a.foo
+       diff $(srcdir)/b.bar $(distdir)/b.bar
+       diff $(builddir)/c.foo $(distdir)/c.foo
+       diff $(builddir)/d.bar $(distdir)/d.bar
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+echo aaa > a.foo
+echo bbb > b.bar
+mkdir build
+echo ccc > build/c.foo
+echo ddd > build/d.bar
+
+cd build
+../configure
+$MAKE test