[Top][All Lists]

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

Re: Data files for unit-testing

From: Al Pacifico
Subject: Re: Data files for unit-testing
Date: Thu, 8 Nov 2007 09:31:08 -0800

On Nov 7, 2007 10:26 PM, Ralf Wildenhues <address@hidden> wrote:
> Hello Al,
> * 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/ contains:
> > TESTS = check_suggest
> > check_PROGRAMS = check_suggest
> > check_suggest_SOURCES = check_suggest.c $(top_builddir)/src/suggest.h
> > check_suggest_CFLAGS = @CHECK_CFLAGS@
> > check_suggest_LDADD = @CHECK_LIBS@ $(top_builddir)/src/
> > 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).

The manual (
"If the variable TESTS is defined, its value is taken to be a list of
programs or scripts to run in order to do the testing. Programs
needing data files should look for them in srcdir (which is both an
environment variable and a make variable) so they work when building
in a separate directory (see Build Directories), and in particular for
the distcheck rule (see Dist)."

On re-reading that, I moved them from the tests subdirectory to src, and added
"dist_check_DATA = sample.xml bogus.xml"
to src/, but that didn't work. I've also tried changing the
line in tests/ to "dist_check_DATA = ../src/sample.xml
../src/bogus.xml" (don't like all the hard-coding of paths,
side-question is how to avoid that), but they still aren't copied.

BTW I am using autoconf 2.61 and automake 1.10, in case you're wondering.

There was a "How do a copy a file" thread recently, but the problem
there was choosing a directory to put the data for the tests in...
seemed like having it in src really is the best choice, and since the
manual said that was proper, I've decided to leave it that way.

If I have to do this manually, where should the shell commands go?.

> Cheers,
> Ralf

Al Pacifico
Seattle, WA

reply via email to

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