2006-05-09 23:35:46 +08:00
|
|
|
/*
|
|
|
|
* utils.c: test utils
|
|
|
|
*
|
2008-12-12 20:45:34 +08:00
|
|
|
* Copyright (C) 2005, 2008 Red Hat, Inc.
|
2006-05-09 23:35:46 +08: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__
|
|
|
|
|
2009-05-13 00:45:14 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2008-08-21 04:48:35 +08:00
|
|
|
double virtTestCountAverage(double *items,
|
|
|
|
int nitems);
|
2006-05-09 23:35:46 +08:00
|
|
|
|
2008-08-21 04:48:35 +08:00
|
|
|
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);
|
2008-02-06 03:27:37 +08:00
|
|
|
|
2006-05-09 23:35:46 +08:00
|
|
|
|
2008-08-21 04:48:35 +08:00
|
|
|
int virtTestDifference(FILE *stream,
|
|
|
|
const char *expect,
|
|
|
|
const char *actual);
|
2006-05-09 23:35:46 +08:00
|
|
|
|
2008-08-21 04:48:35 +08:00
|
|
|
int virtTestMain(int argc,
|
|
|
|
char **argv,
|
|
|
|
int (*func)(int, char **));
|
2008-05-29 23:21:45 +08:00
|
|
|
|
|
|
|
#define VIRT_TEST_MAIN(func) \
|
|
|
|
int main(int argc, char **argv) { \
|
|
|
|
return virtTestMain(argc,argv, func); \
|
|
|
|
}
|
|
|
|
|
2006-05-09 23:35:46 +08:00
|
|
|
#endif /* __VIT_TEST_UTILS_H__ */
|