On 11/27/2013 02:39 PM, Eric Blake wrote:
While trying to debug a failure of virpcitest during 'make
distcheck',
I noticed that with a VPATH build, 'cd tests; ./virpcitest' fails for
an entirely different reason. To reproduce the distcheck failure, I
had to run 'cd tests; abs_srcdir=/path/to/src ./virpcitest'. But we
document in HACKING that all of our tests are supposed to be runnable
without requiring extra environment variables.
The solution: hardcode the location of srcdir into the just-built
binaries, rather than requiring make to prepopulate environment
variables. With this, './virpcitest' passes even in a VPATH build
(provided that $(srcdir) is writable; a followup patch will fix the
conditions required by 'make distcheck').
If desired, I could hack test-libs.sh to be generated from test-libs.in,
and use config.status to substitute things so that our shell script
tests also gain a hard-coded pointer back to the srcdir. However, I'm
not sure it's worth the effort yet.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org