提交 a6c7f474 编写于 作者: J Jim Meyering

avoid many mingw-specific warnings

* tests/virshtest.c (mymain): Use only one definition of this function.
[WIN32]: Call exit(77) to skip the test.
* tests/nodeinfotest.c: Likewise.
上级 57d54689
Tue Oct 28 13:29:14 +0100 2008 Jim Meyering <meyering@redhat.com>
avoid many mingw-specific warnings
* tests/virshtest.c (mymain): Use only one definition of this function.
[WIN32]: Call exit(77) to skip the test.
* tests/nodeinfotest.c: Likewise.
Tue Oct 28 13:29:14 +0100 2008 Jim Meyering <meyering@redhat.com>
cvsignore mingw build artifacts: *.exe
......
......@@ -15,8 +15,6 @@ static char *abs_srcdir;
#define MAX_FILE 4096
#ifdef __linux__
extern int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr nodeinfo);
static int linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile) {
......@@ -64,14 +62,12 @@ static int linuxTestNodeInfo(const void *data) {
abs_srcdir, (const char*)data);
return linuxTestCompareFiles(cpuinfo, output);
}
#endif
static int
mymain(int argc, char **argv)
{
int ret = 0;
#ifdef __linux__
int i;
const char *nodeData[] = {
"nodeinfo-1",
......@@ -82,6 +78,9 @@ mymain(int argc, char **argv)
"nodeinfo-6",
};
char cwd[PATH_MAX];
#ifndef __linux__
exit (77); /* means 'test skipped' for automake */
#endif
abs_srcdir = getenv("abs_srcdir");
if (!abs_srcdir)
......@@ -99,7 +98,6 @@ mymain(int argc, char **argv)
for (i = 0 ; i < ARRAY_CARDINALITY(nodeData); i++)
if (virtTestRun(nodeData[i], 1, linuxTestNodeInfo, nodeData[i]) != 0)
ret = -1;
#endif
return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
......
......@@ -265,8 +265,6 @@ static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) {
argv);
}
#ifndef WIN32
static int
mymain(int argc, char **argv)
{
......@@ -278,6 +276,10 @@ mymain(int argc, char **argv)
if (!abs_srcdir)
abs_srcdir = getcwd(cwd, sizeof(cwd));
#ifdef WIN32
exit (77); /* means 'test skipped' for automake */
#endif
snprintf(buffer, PATH_MAX-1, "test://%s/../docs/testnode.xml", abs_srcdir);
buffer[PATH_MAX-1] = '\0';
progname = argv[0];
......@@ -354,10 +356,5 @@ mymain(int argc, char **argv)
return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
#else /* ! WIN32 */
static int mymain (void) { exit (77); /* means 'test skipped' for automake */ }
#endif /* WIN32 */
VIRT_TEST_MAIN(mymain)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册