From 8e5a8aae8460e171b22d68001a9b89bd517e1eb4 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 20 Feb 2010 17:38:19 +0100 Subject: [PATCH] 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. Signed-off-by: Ralf Wildenhues --- ChangeLog | 13 +++++++++ tests/Makefile.am | 3 ++ tests/Makefile.in | 3 ++ tests/extra10.test | 43 +++++++++++++++++++++++++++ tests/extra11.test | 72 ++++++++++++++++++++++++++++++++++++++++++++++ tests/extra12.test | 52 +++++++++++++++++++++++++++++++++ 6 files changed, 186 insertions(+) create mode 100755 tests/extra10.test create mode 100755 tests/extra11.test create mode 100755 tests/extra12.test diff --git a/ChangeLog b/ChangeLog index 66858c1ed..1729fea20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2010-02-20 Stefano Lattarini + + 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 Fix copyright statement in gnupload script. diff --git a/tests/Makefile.am b/tests/Makefile.am index c1600284c..4b73a627e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -306,6 +306,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/Makefile.in b/tests/Makefile.in index 3d7404669..709739e41 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 000000000..16d06a3dc --- /dev/null +++ b/tests/extra10.test @@ -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 . + +# 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 index 000000000..14dda4233 --- /dev/null +++ b/tests/extra11.test @@ -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 . + +# 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 index 000000000..72b918cb9 --- /dev/null +++ b/tests/extra12.test @@ -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 . + +# 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 -- 2.47.2