dejagnu
[Top][All Lists]
Advanced

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

Re: Fixing the interpretation of $srcdir in DejaGnu


From: Jacob Bachmeyer
Subject: Re: Fixing the interpretation of $srcdir in DejaGnu
Date: Thu, 22 Nov 2018 19:44:18 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0

Ben Elliston wrote:
On Wed, Nov 21, 2018 at 10:33:04PM -0600, Jacob Bachmeyer wrote:
As part of the ongoing efforts to improve Automake integration, [...]
Can you please elaborate on what you mean by Automake integration in
this context?  To my mind, the Dejagnu Makefile and testsuite should
use the standard Automake hooks for DejaGnu testsuites as much as
possible. Looking at Makefile.am, it doesn't seem like there's a lot
of bad hacks there?

This is the ongoing issue of site.exp. (That there are both local and global "site.exp" files adds confusion.) Automake generates a site.exp that sets srcdir to @srcdir@ and the DejaGnu testsuite overrides that in RUNTESTDEFAULTFLAGS. Needing to specify RUNTESTDEFAULTFLAGS is the hack, since it reveals a mismatch between Automake's $srcdir and DejaGnu's $srcdir, but those variables should have the same meaning as I thought had been confirmed in <URL:http://lists.gnu.org/archive/html/bug-dejagnu/2018-11/msg00007.html>. Do I misunderstand?

The problem is that overriding srcdir on the command line has limitations if site.exp also sets srcdir. In particular, there is an interval between loading site.exp and parsing the command line for the second time. During this time, DejaGnu loads the various configuration files (and its own libraries) using values from configuration files before restoring settings from the command line.

Automake sets @srcdir@ to the directory containing testsuite/ which is the "tool's source directory". The DejaGnu testsuite overrides RUNTESTDEFAULTFLAGS to add "--srcdir $(srcdir)/testsuite" which caused problems with locating the tool init files and is ugly. Interestingly, if DejaGnu used recursive make and I understand the Automake manual correctly, the value of @srcdir@ would include testsuite/, if DejaGnu were to be run in @objdir@/testsuite. However, the DejaGnu makefiles are simpler than that and the DejaGnu testsuite is run at top-level in the build tree, so @srcdir@ is the top-level source directory when the testsuite is run.

Once this is fixed and DejaGnu uses Automake's value of $srcdir, there will no longer be a need to specify RUNTEST on the runtest command line either: it can default to ${srcdir}/runtest in testsuite/lib/runtest.exp. (And I will need to add documenting the two primary options for running DejaGnu -- at top-level or in the top testsuite/ directory -- to my local TODO list. There is a third option, of course: specify all of srcdir, objdir, and outdir, either on the command line or in ./site.exp (or, more precisely, "the local init file") in whatever directory DejaGnu is started.)


-- Jacob



reply via email to

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