2006-05-09 19:35:46 +04:00
/*
* utils . c : test utils
*
2009-12-15 11:43:29 +03:00
* Copyright ( C ) 2005 , 2008 - 2009 Red Hat , Inc .
2006-05-09 19:35:46 +04:00
*
* See COPYING . LIB for the License of this software
*
* Karel Zak < kzak @ redhat . com >
*/
# ifndef __VIT_TEST_UTILS_H__
2010-03-09 21:22:22 +03:00
# define __VIT_TEST_UTILS_H__
2006-05-09 19:35:46 +04:00
2010-03-09 21:22:22 +03:00
# include <stdio.h>
2009-05-12 20:45:14 +04:00
2010-03-09 21:22:22 +03:00
# define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */
2009-12-15 11:43:29 +03:00
2008-08-21 00:48:35 +04:00
double virtTestCountAverage ( double * items ,
int nitems ) ;
2006-05-09 19:35:46 +04:00
2009-11-30 22:01:31 +03:00
void virtTestResult ( const char * name , int ret , const char * msg , . . . ) ;
2008-08-21 00:48:35 +04: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-05 22:27:37 +03:00
2009-05-21 18:22:51 +04:00
int virtTestClearLineRegex ( const char * pattern ,
char * string ) ;
2006-05-09 19:35:46 +04:00
2008-08-21 00:48:35 +04:00
int virtTestDifference ( FILE * stream ,
const char * expect ,
const char * actual ) ;
2006-05-09 19:35:46 +04:00
2009-11-30 22:01:31 +03:00
unsigned int virTestGetDebug ( void ) ;
unsigned int virTestGetVerbose ( void ) ;
2009-10-16 19:37:36 +04:00
2008-08-21 00:48:35 +04:00
int virtTestMain ( int argc ,
char * * argv ,
int ( * func ) ( int , char * * ) ) ;
2008-05-29 19:21:45 +04:00
2010-03-09 21:22:22 +03:00
# define VIRT_TEST_MAIN(func) \
2008-05-29 19:21:45 +04:00
int main ( int argc , char * * argv ) { \
return virtTestMain ( argc , argv , func ) ; \
}
2006-05-09 19:35:46 +04:00
# endif /* __VIT_TEST_UTILS_H__ */