automake
[Top][All Lists]
Advanced

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

Re: Data files for unit-testing


From: Ralf Wildenhues
Subject: Re: Data files for unit-testing
Date: Thu, 8 Nov 2007 23:04:05 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Al Pacifico wrote on Thu, Nov 08, 2007 at 06:31:08PM CET:
> On Nov 7, 2007 10:26 PM, Ralf Wildenhues <address@hidden> wrote:
> > * Al Pacifico wrote on Wed, Nov 07, 2007 at 11:27:41PM CET:
> > > What is the best way to distribute data files for use with the check 
> > > target?
> > [...]
> > > tests/Makefile.am contains:
> > > TESTS = check_suggest
[...]
> > > check_DATA = sample.xml bogus.xml
> >
> > To just distribute them I'd say try dist_check_DATA.
> 
> That doesn't seem to work.

> > > When I make check, sample.xml and bogus.xml aren't created... what
> > > should I do differently?
> >
> > Well, what are they created from, and how?  It seems you need to specify
> > their dependencies and rules to create them.
> 
> I am building in a separate directory and when I say they aren't
> created, I really mean they are not copied (apologies, I should have
> been more precise).

Copied from where to where?  At what time, at "make check" time?
Please note that "distribution" is what happens at "make dist" time,
not at build ("make all") or check time.

When you say "I am building in a separate directory", do you mean you do
a VPATH build like this:
  mkdir ../build
  cd ../build
  ../project/configure [OPTIONS]
  make

and then from within the directory build/src, the files under
project/src/ are not visible or copied?  Then you should refer to them
using $(srcdir) or so.

Please note that, whether you name any directory in your project src or
not, does not matter.  The "source tree" is the tree where your project
files live.  In the toplevel of the source tree should be the
configure.ac file.  The "build tree" is rooted at the directory in which
you are when you invoke "configure".  The install tree is what only
exists after you type "make install" (roughly).

Back to your issue.  For example, a typical way to set up a testsuite
using shell commands is to create a file defs.in in the source tree
containing
  address@hidden@

add the line
  AC_CONFIG_FILES([defs])

to configure.ac, and then using this in test scripts:
  . relative/path/to/defs
  # ...
  access test input files like: $srcdir/sample.xml


I hope this helps somewhat, as I've had to guess a bit what you need.
If it doesn't, then maybe it helps if you show what you have and what
commands go wrong (cut and paste them).

Cheers,
Ralf




reply via email to

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