autoconf
[Top][All Lists]
Advanced

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

Re: How to deal with test data in ouf of source tree builds?


From: Nick Bowler
Subject: Re: How to deal with test data in ouf of source tree builds?
Date: Thu, 15 Jun 2017 11:27:55 -0400

Hello Paul,

On 2017-06-15, Paul Menzel <address@hidden> wrote:
> When doing an out of source build of Unbound, the test suite fails
[...]
> In the source directory there is a directory `testdata`, and that gets
> referenced incorrectly in `testcode/unitverify.c`.
[...]
>          verifytest_file("testdata/test_signatures.1", "20070818005004");
[...]
> Unfortunately, I couldn’t find any documentation how to deal with test
> data when building out of the source tree. Should the test data be
> copied to the build directory, despite it being not changed, should it
> be linked, or does the code need to reference only absolute paths, and
> therefore has to be preprocessed(?)?

There are many possible solutions.  The simplest is probably to cd into
the source directory before running the test programs.  But this may have
other undesired effects.

I suggest eliminating the dependency on the working directory completely.

For example, you can pass the location of necessary data files to the
test programs via environment variable(s) or command-line arguments.  If
all your data files are in one place this might be something simple like:

  UNBOUND_TEST_DATA=${srcdir}/testdata ./the_test_program

and the test program can construct filenames based on that environment
variable.

Cheers,
  Nick



reply via email to

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