[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Non-recursive makefile with DejaGnu testsuite
From: |
Bernd Jendrissek |
Subject: |
Non-recursive makefile with DejaGnu testsuite |
Date: |
Fri, 16 Feb 2007 11:45:26 +0200 |
User-agent: |
Mutt/1.4.2.1i |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message
I'm adding a target to my project, an rpcgen-type program, that will
take an input file and compile it to an output, and I want to feed it as
many test vectors as I can think of during 'make check'. DejaGnu seems
to be well suited to throwing zillions of test vectors at the newly
built tool.
Unfortunately I get this error from 'make check-DEJAGNU':
WARNING: Couldn't find tool init file
and from there everything comes crashing down like a pack of cards.
My tool init file is actually in $(top_srcdir)/tests/lib/xdrgen.exp, and
when I hand-edit srcdir in site.exp to "tests" instead of the "." that
automake's rule leaves there, runtest finds the tool init file and
everything goes okay.
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:
2007-02-16 Bernd Jendrissek <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.
diff -up automake-1.9.6/lib/am/dejagnu.am.borig automake-1.9.6/lib/am/dejagnu.am
--- automake-1.9.6/lib/am/dejagnu.am.borig 2005-05-14 22:21:06.000000000
+0200
+++ automake-1.9.6/lib/am/dejagnu.am 2007-02-15 18:26:17.000000000 +0200
@@ -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 @@ endif ! %?CYGNUS%
.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.
@@ -77,7 +80,7 @@ site.exp: Makefile
@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
diff -up automake-1.9.6/lib/Automake/Variable.pm.borig
automake-1.9.6/lib/Automake/Variable.pm
--- automake-1.9.6/lib/Automake/Variable.pm.borig 2005-06-29
23:07:08.000000000 +0200
+++ automake-1.9.6/lib/Automake/Variable.pm 2007-02-15 18:27:02.000000000
+0200
@@ -191,7 +191,8 @@ my %_silent_variable_override =
ARFLAGS => 1,
DEJATOOL => 1,
JAVAC => 1,
- JAVAROOT => 1);
+ JAVAROOT => 1,
+ RUNTESTSRCDIR => 1);
# Count of helper variables used to implement conditional '+='.
my $_appendvar;
diff -up automake-1.9.6/doc/automake.texi.borig automake-1.9.6/doc/automake.texi
--- automake-1.9.6/doc/automake.texi.borig 2005-07-09 11:28:44.000000000
+0200
+++ automake-1.9.6/doc/automake.texi 2007-02-15 18:42:11.000000000 +0200
@@ -6235,6 +6235,10 @@ assumed. The variable @code{DEJATOOL} i
passed, one at a time, as the @option{--tool} argument to
@command{runtest} invocations; it defaults to the name of the package.
+The variable @code{RUNTESTSRCDIR} holds the argument for the
address@hidden flag that @command{make} passes to dejagnu. Its default
+value is @code{$(srcdir)}, but you can override this if necessary.
+
The variable @code{RUNTESTDEFAULTFLAGS} holds the @option{--tool} and
@option{--srcdir} flags that are passed to dejagnu by default; this can be
overridden if necessary.
--
> BTW, sometimes the lack of a specific response indicates *agreement*.
Just in case you thought I was agreeing with you.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFF1XoRwyMv24BBd/gRAnc5AKCTf2QiQO1epTbXDHsFV+2rW5FiOgCdEmU1
bmroa//g7taF3vAvTAXeUIU=
=ndiq
-----END PGP SIGNATURE-----
- Non-recursive makefile with DejaGnu testsuite,
Bernd Jendrissek <=