[libvirt] [PATCH] tests: guarantee abs_srcdir in all C tests

Eric Blake eblake at redhat.com
Wed Nov 27 22:10:57 UTC 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131127/20325fc4/attachment-0001.sig>


More information about the libvir-list mailing list