* 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>
+
+ 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
#define MAX_FILE 4096
-#ifdef __linux__
-
extern int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr nodeinfo);
static int linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile) {
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",
"nodeinfo-6",
};
char cwd[PATH_MAX];
+#ifndef __linux__
+ exit (77); /* means 'test skipped' for automake */
+#endif
abs_srcdir = getenv("abs_srcdir");
if (!abs_srcdir)
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);
}
argv);
}
-
-#ifndef WIN32
static int
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];
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)