From a4ba396bbdc83c49c6330f7e562990b17f397217 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 19 Mar 2006 05:45:33 +0000 Subject: [PATCH] * tests/depcomp6.test, tests/depcomp7.test: New tests, for general `depcomp' functionality, with and without `subdir-objects', with and without `libtool'. * tests/Makefile.am: Adjust. --- ChangeLog | 5 ++ tests/Makefile.am | 2 + tests/Makefile.in | 179 ++++++++++++++++++++++---------------------- tests/depcomp6.test | 102 +++++++++++++++++++++++++ tests/depcomp7.test | 104 +++++++++++++++++++++++++ 5 files changed, 303 insertions(+), 89 deletions(-) create mode 100755 tests/depcomp6.test create mode 100755 tests/depcomp7.test diff --git a/ChangeLog b/ChangeLog index c31c4ea5..ecae5670 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-03-19 Ralf Wildenhues + * tests/depcomp6.test, tests/depcomp7.test: New tests, + for general `depcomp' functionality, with and without + `subdir-objects', with and without `libtool'. + * tests/Makefile.am: Adjust. + * aclocal.in (write_aclocal): Unlink `aclocal.m4' before writing into it, to break a symlinked file. * tests/acloca20.test: New test. diff --git a/tests/Makefile.am b/tests/Makefile.am index e984632f..5b665fea 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -192,6 +192,8 @@ depcomp2.test \ depcomp3.test \ depcomp4.test \ depcomp5.test \ +depcomp6.test \ +depcomp7.test \ depdist.test \ depend.test \ depend2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index bb02d764..dea192ae 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -71,95 +71,96 @@ TESTS = aclibobj.test aclocal.test aclocal3.test aclocal4.test \ defun2.test dejagnu.test dejagnu2.test dejagnu3.test \ dejagnu4.test dejagnu5.test dejagnu6.test dejagnu7.test \ depacl2.test depcomp.test depcomp2.test depcomp3.test \ - depcomp4.test depcomp5.test depdist.test depend.test \ - depend2.test depend3.test depend4.test destdir.test \ - dirforbid.test dirlist.test discover.test distcom2.test \ - distcom3.test distcom4.test distcom5.test distcom6.test \ - distcom7.test distdir.test distname.test dollar.test \ - double.test dup2.test else.test empty.test empty2.test \ - empty3.test empty4.test exdir.test exdir2.test exeext.test \ - exeext2.test exeext3.test exeext4.test exsource.test ext.test \ - ext2.test extra.test extra3.test extra4.test extra5.test \ - extra6.test extra7.test f90only.test flibs.test fn99.test \ - fnoc.test fo.test fonly.test fortdep.test fpinst2.test \ - fpinstall.test gcj.test gcj2.test gcj3.test gcj4.test \ - gcj5.test getopt.test gettext.test gettext2.test gnumake.test \ - gnuwarn.test gnuwarn2.test gnits.test gnits2.test gnits3.test \ - header.test help.test hfs.test hosts.test implicit.test \ - include.test include2.test info.test insh2.test install2.test \ - installdir.test instsh.test instsh2.test instdat.test \ - instdat2.test instexec.test insthook.test instman.test \ - instman2.test instspc.test interp.test interp2.test java.test \ - java2.test java3.test javaprim.test javasubst.test ldadd.test \ - ldflags.test lex.test lex2.test lex3.test lex4.test lex5.test \ - libobj2.test libobj3.test libobj4.test libobj5.test \ - libobj7.test libobj8.test libobj10.test libobj11.test \ - libobj12.test libobj13.test libobj14.test library.test \ - library2.test library3.test libtool.test libtool2.test \ - libtool3.test libtool4.test libtool5.test libtool6.test \ - libtool7.test libtool8.test libtool9.test license.test \ - link_c_cxx.test link_dist.test link_f90_only.test link_fc.test \ - link_fccxx.test link_fcxx.test link_f_only.test lisp2.test \ - lisp3.test lisp4.test lisp5.test lisp6.test lisp7.test \ - lisp8.test listval.test location.test longline.test \ - longlin2.test ltcond.test ltcond2.test ltconv.test ltdeps.test \ - ltlibobjs.test ltlibsrc.test maintclean.test make.test \ - makej.test makevars.test man.test man2.test mclean.test \ - mdate.test mdate2.test mdate3.test mdate4.test missing.test \ - missing2.test missing3.test mkinstall.test mkinst2.test \ - mkinst3.test mmodely.test multlib.test nobase.test nodef.test \ - nodef2.test nodep.test nodepcomp.test nodist.test nodist2.test \ - nodist3.test nogzip.test nogzip2.test noinst.test \ - noinstdir.test nolink.test nostdinc.test number.test \ - obsolete.test order.test outdir.test output.test output2.test \ - output3.test output4.test output5.test output6.test \ - output7.test output8.test output9.test output10.test \ - output11.test output12.test overrid.test parse.test \ - percent.test percent2.test phony.test pluseq.test pluseq2.test \ - pluseq3.test pluseq4.test pluseq5.test pluseq6.test \ - pluseq7.test pluseq8.test pluseq9.test pluseq10.test \ - postproc.test ppf77.test pr2.test pr9.test pr72.test pr87.test \ - pr204.test pr211.test pr220.test pr224.test pr229.test \ - pr243.test pr266.test pr279.test pr279-2.test pr287.test \ - pr300-lib.test pr300-ltlib.test pr300-prog.test pr307.test \ - pr401.test pr401b.test pr401c.test prefix.test primary.test \ - primary2.test primary3.test proginst.test python.test \ - python2.test python3.test python4.test python5.test \ - python6.test python7.test python8.test python9.test \ - python10.test python11.test python12.test recurs.test \ - recurs2.test remake.test remake2.test remake3.test \ - remake4.test remake5.test regex.test req.test reqd.test \ - reqd2.test rulepat.test scripts.test seenc.test sinclude.test \ - srcsub.test srcsub2.test space.test specflg.test specflg2.test \ - specflg3.test specflg6.test specflg7.test specflg8.test \ - specflg9.test spell.test spell2.test spell3.test spelling.test \ - spy.test stamph2.test stdlib.test stdlib2.test strip.test \ - subdir.test subdir2.test subdir3.test subdir4.test \ - subdir5.test subdir6.test subdir7.test subdir8.test \ - subdir9.test subdirbuiltsources.test subcond.test \ - subcond2.test subcond3.test subobj.test subobj2.test \ - subobj3.test subobj4.test subobj5.test subobj6.test \ - subobj7.test subobj8.test subobj9.test subobjname.test \ - subpkg.test subpkg2.test subpkg3.test subst.test subst2.test \ - substref.test substre2.test substtarg.test suffix.test \ - suffix2.test suffix3.test suffix4.test suffix5.test \ - suffix6.test suffix7.test suffix8.test suffix9.test \ - suffix10.test suffix11.test symlink.test symlink2.test \ - symlink3.test syntax.test tags.test tagsub.test tar.test \ - tar2.test tar3.test target-cflags.test targetclash.test \ - txinfo.test txinfo2.test txinfo3.test txinfo4.test \ - txinfo5.test txinfo6.test txinfo7.test txinfo8.test \ - txinfo9.test txinfo10.test txinfo13.test txinfo16.test \ - txinfo17.test txinfo18.test txinfo19.test txinfo20.test \ - txinfo21.test txinfo22.test txinfo23.test txinfo24.test \ - txinfo25.test txinfo26.test txinfo27.test txinfo28.test \ - txinfo29.test txinfo30.test transform.test unused.test \ - vars.test vars3.test vartar.test version.test version2.test \ - version3.test version4.test version6.test version7.test \ - version8.test vpath.test vtexi.test vtexi2.test warnopts.test \ - werror.test werror2.test whoami.test xsource.test yacc.test \ - yacc2.test yacc3.test yacc4.test yacc5.test yacc6.test \ - yacc7.test yacc8.test yaccpp.test yaccvpath.test + depcomp4.test depcomp5.test depcomp6.test depcomp7.test \ + depdist.test depend.test depend2.test depend3.test \ + depend4.test destdir.test dirforbid.test dirlist.test \ + discover.test distcom2.test distcom3.test distcom4.test \ + distcom5.test distcom6.test distcom7.test distdir.test \ + distname.test dollar.test double.test dup2.test else.test \ + empty.test empty2.test empty3.test empty4.test exdir.test \ + exdir2.test exeext.test exeext2.test exeext3.test exeext4.test \ + exsource.test ext.test ext2.test extra.test extra3.test \ + extra4.test extra5.test extra6.test extra7.test f90only.test \ + flibs.test fn99.test fnoc.test fo.test fonly.test fortdep.test \ + fpinst2.test fpinstall.test gcj.test gcj2.test gcj3.test \ + gcj4.test gcj5.test getopt.test gettext.test gettext2.test \ + gnumake.test gnuwarn.test gnuwarn2.test gnits.test gnits2.test \ + gnits3.test header.test help.test hfs.test hosts.test \ + implicit.test include.test include2.test info.test insh2.test \ + install2.test installdir.test instsh.test instsh2.test \ + instdat.test instdat2.test instexec.test insthook.test \ + instman.test instman2.test instspc.test interp.test \ + interp2.test java.test java2.test java3.test javaprim.test \ + javasubst.test ldadd.test ldflags.test lex.test lex2.test \ + lex3.test lex4.test lex5.test libobj2.test libobj3.test \ + libobj4.test libobj5.test libobj7.test libobj8.test \ + libobj10.test libobj11.test libobj12.test libobj13.test \ + libobj14.test library.test library2.test library3.test \ + libtool.test libtool2.test libtool3.test libtool4.test \ + libtool5.test libtool6.test libtool7.test libtool8.test \ + libtool9.test license.test link_c_cxx.test link_dist.test \ + link_f90_only.test link_fc.test link_fccxx.test link_fcxx.test \ + link_f_only.test lisp2.test lisp3.test lisp4.test lisp5.test \ + lisp6.test lisp7.test lisp8.test listval.test location.test \ + longline.test longlin2.test ltcond.test ltcond2.test \ + ltconv.test ltdeps.test ltlibobjs.test ltlibsrc.test \ + maintclean.test make.test makej.test makevars.test man.test \ + man2.test mclean.test mdate.test mdate2.test mdate3.test \ + mdate4.test missing.test missing2.test missing3.test \ + mkinstall.test mkinst2.test mkinst3.test mmodely.test \ + multlib.test nobase.test nodef.test nodef2.test nodep.test \ + nodepcomp.test nodist.test nodist2.test nodist3.test \ + nogzip.test nogzip2.test noinst.test noinstdir.test \ + nolink.test nostdinc.test number.test obsolete.test order.test \ + outdir.test output.test output2.test output3.test output4.test \ + output5.test output6.test output7.test output8.test \ + output9.test output10.test output11.test output12.test \ + overrid.test parse.test percent.test percent2.test phony.test \ + pluseq.test pluseq2.test pluseq3.test pluseq4.test \ + pluseq5.test pluseq6.test pluseq7.test pluseq8.test \ + pluseq9.test pluseq10.test postproc.test ppf77.test pr2.test \ + pr9.test pr72.test pr87.test pr204.test pr211.test pr220.test \ + pr224.test pr229.test pr243.test pr266.test pr279.test \ + pr279-2.test pr287.test pr300-lib.test pr300-ltlib.test \ + pr300-prog.test pr307.test pr401.test pr401b.test pr401c.test \ + prefix.test primary.test primary2.test primary3.test \ + proginst.test python.test python2.test python3.test \ + python4.test python5.test python6.test python7.test \ + python8.test python9.test python10.test python11.test \ + python12.test recurs.test recurs2.test remake.test \ + remake2.test remake3.test remake4.test remake5.test regex.test \ + req.test reqd.test reqd2.test rulepat.test scripts.test \ + seenc.test sinclude.test srcsub.test srcsub2.test space.test \ + specflg.test specflg2.test specflg3.test specflg6.test \ + specflg7.test specflg8.test specflg9.test spell.test \ + spell2.test spell3.test spelling.test spy.test stamph2.test \ + stdlib.test stdlib2.test strip.test subdir.test subdir2.test \ + subdir3.test subdir4.test subdir5.test subdir6.test \ + subdir7.test subdir8.test subdir9.test subdirbuiltsources.test \ + subcond.test subcond2.test subcond3.test subobj.test \ + subobj2.test subobj3.test subobj4.test subobj5.test \ + subobj6.test subobj7.test subobj8.test subobj9.test \ + subobjname.test subpkg.test subpkg2.test subpkg3.test \ + subst.test subst2.test substref.test substre2.test \ + substtarg.test suffix.test suffix2.test suffix3.test \ + suffix4.test suffix5.test suffix6.test suffix7.test \ + suffix8.test suffix9.test suffix10.test suffix11.test \ + symlink.test symlink2.test symlink3.test syntax.test tags.test \ + tagsub.test tar.test tar2.test tar3.test target-cflags.test \ + targetclash.test txinfo.test txinfo2.test txinfo3.test \ + txinfo4.test txinfo5.test txinfo6.test txinfo7.test \ + txinfo8.test txinfo9.test txinfo10.test txinfo13.test \ + txinfo16.test txinfo17.test txinfo18.test txinfo19.test \ + txinfo20.test txinfo21.test txinfo22.test txinfo23.test \ + txinfo24.test txinfo25.test txinfo26.test txinfo27.test \ + txinfo28.test txinfo29.test txinfo30.test transform.test \ + unused.test vars.test vars3.test vartar.test version.test \ + version2.test version3.test version4.test version6.test \ + version7.test version8.test vpath.test vtexi.test vtexi2.test \ + warnopts.test werror.test werror2.test whoami.test \ + xsource.test yacc.test yacc2.test yacc3.test yacc4.test \ + yacc5.test yacc6.test yacc7.test yacc8.test yaccpp.test \ + yaccvpath.test subdir = tests DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs.in diff --git a/tests/depcomp6.test b/tests/depcomp6.test new file mode 100755 index 00000000..7de5a170 --- /dev/null +++ b/tests/depcomp6.test @@ -0,0 +1,102 @@ +#! /bin/sh +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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. +# +# GNU Automake 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 Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +# Check dependency generation (non libtool case). + +. ./defs || exit 1 + +set -e + +cat >> configure.in << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_RANLIB +AC_CONFIG_FILES(sub2/Makefile) +AC_OUTPUT +END + +mkdir sub sub2 sub2/sub3 + +cat >Makefile.am <<'END' +SUBDIRS = sub2 +bin_PROGRAMS = foo +foo_SOURCES = foo.c sub/bar.c foo.h sub/bar.h +foo_LDADD = sub2/libbaz.a +END + +cat >sub2/Makefile.am <<'END' +AUTOMAKE_OPTIONS = subdir-objects +noinst_LIBRARIES = libbaz.a +libbaz_a_SOURCES = baz.c sub3/ba3.c baz.h sub3/ba3.h +END + +cat >foo.c <<'END' +#include "foo.h" +#include "sub2/baz.h" +#include +int main() { printf("foo"); return bar() + baz(); } +END + +cat >foo.h <<'END' +#include +#include "sub/bar.h" +END + +cat >sub/bar.c <<'END' +#include "sub/bar.h" +int bar() { return 0; } +END + +touch sub2/sub3/ba3.h + +cat >sub/bar.h <<'END' +#include +extern int bar(); +END + +cat >sub2/baz.c <<'END' +#include "baz.h" +int baz() { return 0; } +END + +cat >sub2/baz.h <<'END' +extern int baz(); +END + +cat >sub2/sub3/ba3.c <<'END' +#include "ba3.h" +int ba3() { return 0; } +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +./configure --enable-dependency-tracking +$MAKE + +# check that dependency tracking works +if grep 'depmode=none' Makefile; then : +else + cd sub2 + $sleep + echo 'choke me' > sub3/ba3.h + $MAKE && exit 1 +fi diff --git a/tests/depcomp7.test b/tests/depcomp7.test new file mode 100755 index 00000000..98bb77b4 --- /dev/null +++ b/tests/depcomp7.test @@ -0,0 +1,104 @@ +#! /bin/sh +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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. +# +# GNU Automake 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 Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +# Check dependency generation (libtool case). + +required='libtoolize' +. ./defs || exit 1 + +set -e + +cat >> configure.in << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AM_PROG_LIBTOOL +AC_CONFIG_FILES(sub2/Makefile) +AC_OUTPUT +END + +mkdir sub sub2 sub2/sub3 + +cat >Makefile.am <<'END' +SUBDIRS = sub2 +bin_PROGRAMS = foo +foo_SOURCES = foo.c sub/bar.c foo.h sub/bar.h +foo_LDADD = sub2/libbaz.la +END + +cat >sub2/Makefile.am <<'END' +AUTOMAKE_OPTIONS = subdir-objects +noinst_LTLIBRARIES = libbaz.la +libbaz_la_SOURCES = baz.c sub3/ba3.c baz.h sub3/ba3.h +END + +cat >foo.c <<'END' +#include "foo.h" +#include "sub2/baz.h" +#include +int main() { printf("foo"); return bar() + baz(); } +END + +cat >foo.h <<'END' +#include +#include "sub/bar.h" +END + +cat >sub/bar.c <<'END' +#include "sub/bar.h" +int bar() { return 0; } +END + +touch sub2/sub3/ba3.h + +cat >sub/bar.h <<'END' +#include +extern int bar(); +END + +cat >sub2/baz.c <<'END' +#include "baz.h" +int baz() { return 0; } +END + +cat >sub2/baz.h <<'END' +extern int baz(); +END + +cat >sub2/sub3/ba3.c <<'END' +#include "ba3.h" +int ba3() { return 0; } +END + +libtoolize +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +./configure --enable-dependency-tracking +$MAKE + +# check that dependency tracking works +if grep 'depmode=none' Makefile; then : +else + cd sub2 + $sleep + echo 'choke me' > sub3/ba3.h + $MAKE && exit 1 +fi -- 2.43.5