Now C tests are able to access argc/argv as passed to the program.

oldstable
Eric Pouech 2002-04-20 20:51:11 +00:00 committed by Alexandre Julliard
parent de61088197
commit fbaef1cc9a
2 changed files with 14 additions and 0 deletions

View File

@ -38,6 +38,7 @@ extern winetest_trace_funcptr winetest_set_trace_location( const char* file, int
extern void winetest_start_todo( const char* platform );
extern int winetest_loop_todo(void);
extern void winetest_end_todo( const char* platform );
extern int winetest_get_mainargs( char*** pargv );
#define START_TEST(name) void func_##name(void)

View File

@ -35,6 +35,10 @@ const char *winetest_platform = "windows";
/* report successful tests (BOOL) */
int winetest_report_success = 0;
/* passing arguments around */
static int winetest_argc;
static char** winetest_argv;
struct test
{
const char *name;
@ -192,6 +196,12 @@ void winetest_end_todo( const char* platform )
}
}
int winetest_get_mainargs( char*** pargv )
{
*pargv = winetest_argv;
return winetest_argc;
}
/* Find a test by name */
static const struct test *find_test( const char *name )
{
@ -245,6 +255,9 @@ int main( int argc, char **argv )
{
char *p;
winetest_argc = argc;
winetest_argv = argv;
if ((p = getenv( "WINETEST_PLATFORM" ))) winetest_platform = p;
if ((p = getenv( "WINETEST_DEBUG" ))) winetest_debug = atoi(p);
if ((p = getenv( "WINETEST_REPORT_SUCCESS"))) winetest_report_success = \