[Top][All Lists]
[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: |
Sat, 17 Feb 2007 17:45:00 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Hello Bernd,
* Bernd Jendrissek wrote on Fri, Feb 16, 2007 at 10:45:26AM CET:
>
> Here is the problem: automake's rule for site.exp:
>
> site.exp: Makefile
> [snip]
> @echo 'set srcdir $(srcdir)' >>site.tmp
> @echo "set objdir `pwd`" >>site.tmp
> [snip]
> @mv site.tmp site.exp
>
> It's because I have a non-recursive makefile, so $(srcdir) is the same
> as $(top_srcdir), but (DejaGnu) srcdir should be $(top_srcdir)/tests.
>
> This works for me (8 lines of changes, sub-threshold for copyright?); I
> now get the correct site.exp with this patch:
Thanks for the report and patch. Please have patience with me, I don't
have a lot of experience with dejagnu.
At first, I thought what you wanted could be achieved by overriding:
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir/tests
But it seems things aren't that simple, or I made some other error while
trying this. Anyway you change needs a test to go along with it, so we
ensure the functionality isn't broken later, and that test could also
help fix my thinko. Here's a proposed test to go along with your patch,
adapted from dejagnu3.test, except that it doesn't work. Could you
(show me how to) fix it? I think that will also show better what you
want to achieve. Thanks.
Cheers,
Ralf
* tests/dejagnu8.test: New test.
* tests/Makefile.am: Update.
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 17 Feb 2007 16:44:41 -0000
@@ -191,6 +193,7 @@
dejagnu5.test \
dejagnu6.test \
dejagnu7.test \
+dejagnu8.test \
depacl2.test \
depcomp.test \
depcomp2.test \
--- /dev/null 2007-02-11 11:22:03.168311497 +0100
+++ tests/dejagnu8.test 2007-02-16 20:40:04.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 = tests
+EXTRA_DIST = tests/hammer tests/hammer.test/hammer.exp
+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
+test -f tests/hammer.log
+test -f tests/hammer.sum
+
+$MAKE distcheck
- Re: Non-recursive makefile with DejaGnu testsuite,
Ralf Wildenhues <=