summaryrefslogtreecommitdiff
path: root/t/extra-deps.sh
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-01-02 13:31:31 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-01-02 13:32:49 +0100
commit5fbe39b56f17cba2586e2852194fcb005107f46f (patch)
treeba8fb31a8659dd6a3436ad25b438f68fc5432cb9 /t/extra-deps.sh
parent10ead727bf246b0aac5b277763152bcd26559e1e (diff)
downloadautomake-5fbe39b56f17cba2586e2852194fcb005107f46f.tar.gz
tests: more significant names for some tests
* t/extra5.sh: Rename .... * t/extra-dist-vpath-dir.sh: ... like this. * t/extra6.sh: Rename .... * t/extra-dist-dirs-and-subdirs.sh: ... like this. * t/extra7.sh: Rename .... * t/extra-dist-vpath-dir-merge.sh: ... like this. * t/extra8.sh: Rename .... * t/extra-programs-misc.sh: ... like this. * t/extra9.sh: Rename .... * t/extra-programs-and-libs.sh: ... like this. * t/extra10.sh: Rename .... * t/extra-dist-wildcards.sh: ... like this. * t/extra11.sh: Rename .... * t/extra-dist-wildcards-gnu.sh: ... like this. * t/extra12.sh: Rename .... * t/extra-dist-wildcards-vpath.sh: ... like this. * t/extradep.sh: Rename .... * t/extra-deps.sh: ... like this, and adjust heading comments. * t/extradep2.sh: Rename .... * t/extra-deps-lt.sh: ... like this, and adjust heading comments. * t/list-of-tests.mk: Adjust. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/extra-deps.sh')
-rwxr-xr-xt/extra-deps.sh105
1 files changed, 105 insertions, 0 deletions
diff --git a/t/extra-deps.sh b/t/extra-deps.sh
new file mode 100755
index 000000000..3bd6d1d03
--- /dev/null
+++ b/t/extra-deps.sh
@@ -0,0 +1,105 @@
+#! /bin/sh
+# Copyright (C) 2010-2013 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 EXTRA_*_DEPENDENCIES. See 'extra-deps-lt.sh' for libtool variant.
+
+required=cc
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_SUBST([deps], [bardep])
+AM_CONDITIONAL([COND], [test -n "$cond"])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libfoo.a
+EXTRA_libfoo_a_DEPENDENCIES = libfoodep
+libfoodep:
+ @echo making $@
+ @: > $@
+CLEANFILES = libfoodep
+
+bin_PROGRAMS = foo bar
+EXTRA_foo_DEPENDENCIES = foodep
+if COND
+EXTRA_foo_DEPENDENCIES += foodep2
+endif
+bar_LDADD = libfoo.a
+EXTRA_bar_DEPENDENCIES = $(deps)
+
+EXTRA_DIST = foodep bardep
+
+.PHONY: bar-has-been-updated
+bar-has-been-updated:
+ is_newest bar$(EXEEXT) libfoo.a
+END
+
+cat >libfoo.c <<'END'
+int libfoo () { return 0; }
+END
+
+cat >foo.c <<'END'
+int main () { return 0; }
+END
+
+cat >bar.c <<'END'
+extern int libfoo ();
+int main () { return libfoo (); }
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure cond=yes
+
+# Hypotheses:
+# - EXTRA_*_DEPENDENCIES are honored.
+# - Conditionals and substitutions are honored.
+# - *_DEPENDENCIES are not overwritten by their EXTRA_* counterparts.
+
+: >foodep
+: >foodep2
+: >bardep
+$MAKE >stdout || { cat stdout; exit 1; }
+cat stdout
+grep 'making libfoodep' stdout
+
+rm -f foodep
+$MAKE && exit 1
+: >foodep
+
+rm -f foodep2
+$MAKE && exit 1
+: >foodep2
+
+rm -f bardep
+$MAKE && exit 1
+: >bardep
+
+$MAKE
+$sleep
+touch libfoo.a
+$MAKE
+$MAKE bar-has-been-updated
+
+$MAKE distcheck
+
+: