Wine's test infrastructure allows to call ./wine <test>.exe without test name when only a single test is available in <test>.exe.
Unfortunately, a lots of tests also rely on winetest_argv[1] to be the name of current test (esp. when respawning themselves to run sub processes).
So, ensure wintest_argv is correctly populated in the case of a <test> containing a single test file and called without any argument on command line.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- include/wine/test.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/wine/test.h b/include/wine/test.h index 599234b3519..bf6f5ad856f 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -691,7 +691,11 @@ int main( int argc, char **argv ) if (!argv[1]) { if (winetest_testlist[0].name && !winetest_testlist[1].name) /* only one test */ + { + char* fake_argv[3] = {argv[0], strdup(winetest_testlist[0].name), NULL}; + winetest_argv = fake_argv; return run_test( winetest_testlist[0].name ); + } usage( argv[0] ); } if (!strcmp( argv[1], "--list" ))