When running the tests on Windows you can either do 'xxx_test.exe' which gives you a list of the available tests for this executable, or 'xxx_test.exe foo' which runs test foo, and only test foo.
So I propose the following patch which makes it possible to run 'xxx_test.exe all' which runs all the tests implemented by that executable.
Do others find this patch acceptable? Useful?
Index: include/wine/test.h =================================================================== RCS file: /home/wine/wine/include/wine/test.h,v retrieving revision 1.7 diff -u -r1.7 test.h --- include/wine/test.h 30 Oct 2002 20:36:21 -0000 1.7 +++ include/wine/test.h 30 Nov 2002 04:46:23 -0000 @@ -319,7 +319,23 @@ if ((p = getenv( "WINETEST_REPORT_SUCCESS"))) report_success = atoi(p); if (!argv[1]) usage( argv[0] );
- return run_test(argv[1]); + if (strcmp(argv[1], "all") == 0) + { + const struct test* test; + int status=0; + + for (test = winetest_testlist; test->name; test++) + { + fprintf(stderr, "Testing %s\n", test->name); + status+=run_test(test->name); + fprintf(stderr, "\n"); + } + return (status <= 255) ? status : 255; + } + else + { + return run_test(argv[1]); + } }
#endif /* WINETEST_WANT_MAIN */
Francois Gouget fgouget@free.fr writes:
So I propose the following patch which makes it possible to run 'xxx_test.exe all' which runs all the tests implemented by that executable.
Do others find this patch acceptable? Useful?
The drawback I see is that with this change the tests do not start with a clean process state, which could cause problem for some of them. Or we need to require that all tests cleanup properly after them, which may be a bit painful.
On 30 Nov 2002, Alexandre Julliard wrote: [...]
Do others find this patch acceptable? Useful?
The drawback I see is that with this change the tests do not start with a clean process state, which could cause problem for some of them. Or we need to require that all tests cleanup properly after them, which may be a bit painful.
Tests have to cleanup behind themselves to some extent otherwise it means they cannot be run twice in a row and that would be very bad. But yes, they might leave static variables behind or environment variables or whatnot. That would really not be very clean. The tests don't work well enough on Windows that I know whether that is the case or not.
Note that it would be pretty easy to just 'system("xxx_test.exe foo") each individual test which would solve the above issue. It may be that with Patrik's script for running all tests the need for an 'xxx_test.exe all' may be lower. I'll play some more with the tests and maybe I'll submit a patch that adds an 'all' option based on 'system'.