libvirt/tests/testutils.h

53 lines
1.4 KiB
C
Raw Normal View History

2006-05-09 15:35:46 +00:00
/*
* utils.c: test utils
*
* Copyright (C) 2005, 2008-2009 Red Hat, Inc.
2006-05-09 15:35:46 +00:00
*
* See COPYING.LIB for the License of this software
*
* Karel Zak <kzak@redhat.com>
*/
#ifndef __VIT_TEST_UTILS_H__
# define __VIT_TEST_UTILS_H__
2006-05-09 15:35:46 +00:00
# include <stdio.h>
# define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */
double virtTestCountAverage(double *items,
int nitems);
2006-05-09 15:35:46 +00:00
void virtTestResult(const char *name, int ret, const char *msg, ...);
int virtTestRun(const char *title,
int nloops,
int (*body)(const void *data),
const void *data);
int virtTestLoadFile(const char *name,
char **buf,
int buflen);
int virtTestCaptureProgramOutput(const char *const argv[],
char **buf,
int buflen);
int virtTestClearLineRegex(const char *pattern,
char *string);
2006-05-09 15:35:46 +00:00
int virtTestDifference(FILE *stream,
const char *expect,
const char *actual);
2006-05-09 15:35:46 +00:00
unsigned int virTestGetDebug(void);
unsigned int virTestGetVerbose(void);
int virtTestMain(int argc,
char **argv,
int (*func)(int, char **));
# define VIRT_TEST_MAIN(func) \
int main(int argc, char **argv) { \
return virtTestMain(argc,argv, func); \
}
2006-05-09 15:35:46 +00:00
#endif /* __VIT_TEST_UTILS_H__ */