mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Arrange for tests to pass in a non-srcdir build.
* tests/Makefile.am: Include the contents of the *data directories in the make-dist-built tarball by adding each of that *data directories to EXTRA_DIST. Also add int-overflow (via $(test_scripts)) to EXTRA_DIST. * tests/nodeinfotest.c: Prepend "$abs_top_srcdir/tests" to each input file name. * tests/qemuxml2argvtest.c: Likewise. * tests/qemuxml2xmltest.c: Likewise. * tests/sexpr2xmltest.c: Likewise. * tests/test_conf.sh: Likewise. * tests/virshtest.c: Likewise. * tests/xencapstest.c: Likewise. * tests/xmconfigtest.c: Likewise. * tests/xml2sexprtest.c: Likewise. Author: Jim Meyering <meyering@redhat.com>
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "internal.h"
|
||||
|
||||
static char *progname;
|
||||
static char *abs_top_srcdir;
|
||||
struct qemud_driver driver;
|
||||
|
||||
#define MAX_FILE 4096
|
||||
@@ -59,7 +60,8 @@ static int testCompareXMLToXMLFiles(const char *xml) {
|
||||
|
||||
static int testCompareXMLToXMLHelper(const void *data) {
|
||||
char xml[PATH_MAX];
|
||||
snprintf(xml, PATH_MAX, "qemuxml2argvdata/qemuxml2argv-%s.xml", (const char*)data);
|
||||
snprintf(xml, PATH_MAX, "%s/tests/qemuxml2argvdata/qemuxml2argv-%s.xml",
|
||||
abs_top_srcdir, (const char*)data);
|
||||
return testCompareXMLToXMLFiles(xml);
|
||||
}
|
||||
|
||||
@@ -76,6 +78,10 @@ main(int argc, char **argv)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
abs_top_srcdir = getenv("abs_top_srcdir");
|
||||
if (!abs_top_srcdir)
|
||||
return 1;
|
||||
|
||||
if (virtTestRun("QEMU XML-2-ARGV minimal",
|
||||
1, testCompareXMLToXMLHelper, "minimal") < 0)
|
||||
ret = -1;
|
||||
|
||||
Reference in New Issue
Block a user