Commit 95b87814 authored by Alexandre Julliard's avatar Alexandre Julliard

Added --list option to the tests and use that in winetest.

parent eeb0a90e
......@@ -285,6 +285,16 @@ static const struct test *find_test( const char *name )
}
/* Display list of valid tests */
static void list_tests(void)
{
const struct test *test;
fprintf( stdout, "Valid test names:\n" );
for (test = winetest_testlist; test->name; test++) fprintf( stdout, " %s\n", test->name );
}
/* Run a named test, and return exit status */
static int run_test( const char *name )
{
......@@ -316,11 +326,8 @@ static int run_test( const char *name )
/* Display usage and exit */
static void usage( const char *argv0 )
{
const struct test *test;
fprintf( stdout, "Usage: %s test_name\n", argv0 );
fprintf( stdout, "\nValid test names:\n" );
for (test = winetest_testlist; test->name; test++) fprintf( stdout, " %s\n", test->name );
fprintf( stdout, "Usage: %s test_name\n\n", argv0 );
list_tests();
exit_process(1);
}
......@@ -345,6 +352,11 @@ int main( int argc, char **argv )
return run_test( winetest_testlist[0].name );
usage( argv[0] );
}
if (!strcmp( argv[1], "--list" ))
{
list_tests();
return 0;
}
return run_test(argv[1]);
}
......
......@@ -348,7 +348,7 @@ run_ex (char *cmd, const char *out, DWORD ms)
void
get_subtests (const char *tempdir, struct wine_test *test, int id)
{
char *subname;
char *subname, *cmd;
FILE *subfile;
size_t total;
char buffer[8192], *index;
......@@ -361,7 +361,9 @@ get_subtests (const char *tempdir, struct wine_test *test, int id)
if (!subname) report (R_FATAL, "Can't name subtests file.");
extract_test (test, tempdir, id);
run_ex (test->exename, subname, 5000);
cmd = strmake (NULL, "%s --list", test->exename);
run_ex (cmd, subname, 5000);
free (cmd);
subfile = fopen (subname, "r");
if (!subfile) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment