automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-recursive makefile with DejaGnu testsuite


From: Ralf Wildenhues
Subject: Re: Non-recursive makefile with DejaGnu testsuite
Date: Fri, 23 Feb 2007 18:36:24 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

[ automake list dropped ]

Thanks for all your comments.  The combined patch looks now like this
for me.  What's worrying me is that
  cd tests
  make check VERBOSE=yes TESTS=dejagnu8.test

still outputs the warning:
| WARNING: Couldn't find tool init file

at 'make check' and distcheck time in the test, which you were
originally concerned about.  That doesn't seem right to me.
Can you find out what's wrong?

Cheers,
Ralf

2007-02-23  Bernd Jendrissek  <address@hidden>
            Ralf Wildenhues  <address@hidden>

        * lib/am/dejagnu.am (RUNTESTSRCDIR): Specify location of
        test directories.
        * lib/Automake/Variable.pm (%_silent_variable_override): Add
        RUNTESTSRCDIR.
        * doc/automake.texi (Tests): Describe RUNTESTSRCDIR.
        * tests/dejagnu8.test: New test.
        * tests/Makefile.am: Update.

Index: lib/am/dejagnu.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/dejagnu.am,v
retrieving revision 1.25
diff -u -r1.25 dejagnu.am
--- lib/am/dejagnu.am   20 Apr 2006 16:24:15 -0000      1.25
+++ lib/am/dejagnu.am   23 Feb 2007 17:35:58 -0000
@@ -20,6 +20,9 @@
 ## Name of tool to use.  Default is the same as the package.
 DEJATOOL = $(PACKAGE)
 
+## Path to a directory containing test directories.  Default is $(srcdir)
+RUNTESTSRCDIR = $(srcdir)
+
 ## Default flags to pass to dejagnu.  The user can override this.
 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
 
@@ -46,7 +49,7 @@
 .PHONY: check-DEJAGNU
 check-DEJAGNU: site.exp
 ## Life is easiest with an absolute srcdir, so do that.
-       srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
+       srcdir=`$(am__cd) $(RUNTESTSRCDIR) && pwd`; export srcdir; \
        EXPECT=$(EXPECT); export EXPECT; \
 ## Allow this to work when expect and DejaGnu are in tree.
 ## Only required when --cygnus in force.
@@ -79,7 +82,7 @@
        @echo '## these variables are automatically generated by make ##' 
>site.tmp
        @echo '# Do not edit here.  If you wish to override these values' 
>>site.tmp
        @echo '# edit the last section' >>site.tmp
-       @echo 'set srcdir $(srcdir)' >>site.tmp
+       @echo 'set srcdir $(RUNTESTSRCDIR)' >>site.tmp
        @echo "set objdir `pwd`" >>site.tmp
 ## Quote the *_alias variables because they might be empty.
 ?BUILD?        @echo 'set build_alias "$(build_alias)"' >>site.tmp
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.617
diff -u -r1.617 Makefile.am
--- tests/Makefile.am   16 Oct 2006 05:24:17 -0000      1.617
+++ tests/Makefile.am   23 Feb 2007 17:35:58 -0000
@@ -191,6 +191,7 @@
 dejagnu5.test \
 dejagnu6.test \
 dejagnu7.test \
+dejagnu8.test \
 depacl2.test \
 depcomp.test \
 depcomp2.test \
--- /dev/null   2007-02-18 16:55:03.224314998 +0100
+++ tests/dejagnu8.test 2007-02-23 18:34:43.000000000 +0100
@@ -0,0 +1,68 @@
+#! /bin/sh
+# Copyright (C) 2003, 2007  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 that RUNTESTSRCDIR can be set to a subdirectory.
+
+required=runtest
+. ./defs || exit 1
+
+set -e
+
+mkdir tests
+
+cat > tests/hammer << 'END'
+#! /bin/sh
+echo "Everything looks like a nail to me!"
+END
+
+chmod +x tests/hammer
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = dejagnu
+DEJATOOL = hammer
+AM_RUNTESTFLAGS = HAMMER=$(srcdir)/tests/hammer
+RUNTESTSRCDIR = $(srcdir)/tests
+EXTRA_DIST = tests/hammer tests/hammer.test/hammer.exp
+check-local:
+       test -f hammer.log
+       test -f hammer.sum
+       grep "PASS: test" hammer.log
+END
+
+mkdir tests/hammer.test
+
+cat > tests/hammer.test/hammer.exp << 'END'
+set test test
+spawn $HAMMER
+expect {
+    "Everything looks like a nail to me!" { pass "$test" }
+    default { fail "$test" }
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE check
+$MAKE distcheck




reply via email to

[Prev in Thread] Current Thread [Next in Thread]