Now C tests are able to access argc/argv as passed to the program.
This commit is contained in:
parent
de61088197
commit
fbaef1cc9a
|
@ -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 void winetest_start_todo( const char* platform );
|
||||||
extern int winetest_loop_todo(void);
|
extern int winetest_loop_todo(void);
|
||||||
extern void winetest_end_todo( const char* platform );
|
extern void winetest_end_todo( const char* platform );
|
||||||
|
extern int winetest_get_mainargs( char*** pargv );
|
||||||
|
|
||||||
#define START_TEST(name) void func_##name(void)
|
#define START_TEST(name) void func_##name(void)
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@ const char *winetest_platform = "windows";
|
||||||
/* report successful tests (BOOL) */
|
/* report successful tests (BOOL) */
|
||||||
int winetest_report_success = 0;
|
int winetest_report_success = 0;
|
||||||
|
|
||||||
|
/* passing arguments around */
|
||||||
|
static int winetest_argc;
|
||||||
|
static char** winetest_argv;
|
||||||
|
|
||||||
struct test
|
struct test
|
||||||
{
|
{
|
||||||
const char *name;
|
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 */
|
/* Find a test by name */
|
||||||
static const struct test *find_test( const char *name )
|
static const struct test *find_test( const char *name )
|
||||||
{
|
{
|
||||||
|
@ -245,6 +255,9 @@ int main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
winetest_argc = argc;
|
||||||
|
winetest_argv = argv;
|
||||||
|
|
||||||
if ((p = getenv( "WINETEST_PLATFORM" ))) winetest_platform = p;
|
if ((p = getenv( "WINETEST_PLATFORM" ))) winetest_platform = p;
|
||||||
if ((p = getenv( "WINETEST_DEBUG" ))) winetest_debug = atoi(p);
|
if ((p = getenv( "WINETEST_DEBUG" ))) winetest_debug = atoi(p);
|
||||||
if ((p = getenv( "WINETEST_REPORT_SUCCESS"))) winetest_report_success = \
|
if ((p = getenv( "WINETEST_REPORT_SUCCESS"))) winetest_report_success = \
|
||||||
|
|
Loading…
Reference in New Issue