diff --git a/documentation/testing.sgml b/documentation/testing.sgml index 6e1ee11c277..f2851319afe 100644 --- a/documentation/testing.sgml +++ b/documentation/testing.sgml @@ -65,7 +65,7 @@ When a test fails, one immediately knows what was the expected behavior and which APIs are involved. Thus regressions caught this way should be detected earlier, because it is easy to run - all tests on a regular basis, and easier to fix because of the + all tests on a regular basis, and be easier to fix because of the reduced diagnosis work. @@ -118,7 +118,8 @@ set its contents, possibly check length restrictions, and verify the results using WM_GETTEXT. Similarly one could create a listbox and check the effect of LB_DELETESTRING on the list's number of items, - selected items list, highlighted item, etc. + selected items list, highlighted item, etc. For concrete examples, + see dlls/user/tests/win.c and the related tests. However, undocumented behavior should not be tested for unless there @@ -167,11 +168,12 @@ following: $ ../../../tools/runtest -q -M kernel32.dll -p kernel32_test.exe.so thread.c -$ ../../../tools/runtest -p kernel32_test.exe.so thread.c +$ ../../../tools/runtest -P wine -p kernel32_test.exe.so thread.c thread.c: 86 tests executed, 5 marked as todo, 0 failures. - The '-P wine' options defines the platform that is currently being - tested. Remove the '-q' option if you want the testing framework + The '-P wine' option defines the platform that is currently being + tested and is used in conjunction with the 'todo' statements (see + below). Remove the '-q' option if you want the testing framework to report statistics about the number of successful and failed tests. Run runtest -h for more details. @@ -189,8 +191,15 @@ thread.c: 86 tests executed, 5 marked as todo, 0 failures. Debian GNU/Linux - On Debian all you need to do is type apt-get install - mingw32. + On Debian do apt-get install mingw32. + + + The standard MinGW libraries will probably be incomplete, causing + 'undefined symbol' errors. So get the latest + mingw-w32api RPM + and use alien to either convert it to a .tar.gz file + from which to extract just the relevant files, or to convert it + to a Debian package that you will install. @@ -241,11 +250,15 @@ thread.c: 86 tests executed, 5 marked as todo, 0 failures. Using pre-compiled binaries - Unfortunately there are no pre-compiled binaries yet. However if - send an email to the Wine development list you can probably get - someone to send them to you, and maybe motivate some kind soul to - put in place a mechanism for publishing such binaries on a regular - basis. + The simplest solution is to download the + latest + version of winetest. This executable contains all the Wine + conformance tests, runs them and reports the results. + + + You can also get the older versions from + Paul + Millar's website. @@ -322,7 +335,7 @@ thread.c: 86 tests executed, 5 marked as todo, 0 failures. method. So to run the kernel 'path' tests you would do: C:\>cd dlls\kernel\tests\Output\Win32_MSVC_Headers -C:\dlls\kernel\tests\Output\Win32_MSVC_Headers>kernel32_test path +C:\wine\dlls\kernel\tests\Output\Win32_MSVC_Headers> kernel32_test path @@ -386,8 +399,8 @@ START_TEST(paths) You can use trace to print informational messages. Note that these messages will only be printed if 'runtest -v' is being used. - trace("testing GlobalAddAtomA"); - trace("foo=%d",foo); + trace("testing GlobalAddAtomA\n"); + trace("foo=%d\n",foo); @@ -395,8 +408,8 @@ START_TEST(paths) they behaved as expected: ATOM atom = GlobalAddAtomA( "foobar" ); - ok( GlobalFindAtomA( "foobar" ) == atom, "could not find atom foobar" ); - ok( GlobalFindAtomA( "FOOBAR" ) == atom, "could not find atom FOOBAR" ); + ok( GlobalFindAtomA( "foobar" ) == atom, "could not find atom foobar\n" ); + ok( GlobalFindAtomA( "FOOBAR" ) == atom, "could not find atom FOOBAR\n" ); The first parameter of ok is an expression which must evaluate to true if the test was successful. The next parameter is a @@ -431,7 +444,7 @@ START_TEST(paths) of a bad error message: ok(GetThreadPriorityBoost(curthread,&disabled)!=0, - "GetThreadPriorityBoost Failed"); + "GetThreadPriorityBoost Failed\n"); This will yield: @@ -451,7 +464,7 @@ thread.c:123: Test failed: GetThreadPriorityBoost Failed BOOL rc; ... rc=GetThreadPriorityBoost(curthread,&disabled); - ok(rc!=0 && disabled==0,"rc=%d error=%ld disabled=%d", + ok(rc!=0 && disabled==0,"rc=%d error=%ld disabled=%d\n", rc,GetLastError(),disabled); This will yield: @@ -485,7 +498,7 @@ thread.c:123: Test failed: rc=0 error=120 disabled=0 for some tests you may want to define a macro such as the following: #define eq(received, expected, label, type) \ - ok((received) == (expected), "%s: got " type " instead of " type, (label),(received),(expected)) + ok((received) == (expected), "%s: got " type " instead of " type "\n", (label),(received),(expected)) ... @@ -512,7 +525,7 @@ thread.c:123: Test failed: rc=0 error=120 disabled=0 todo_wine { SetLastError( 0xdeadbeef ); - ok( GlobalAddAtomA(0) == 0 && GetLastError() == 0xdeadbeef, "failed to add atom 0" ); + ok( GlobalAddAtomA(0) == 0 && GetLastError() == 0xdeadbeef, "failed to add atom 0\n" ); } On Windows the above check would be performed normally, but on Wine it @@ -567,7 +580,7 @@ ok ( GetLastError() == WIN9X_ERROR || GetLastError() == NT_ERROR, ...); + file handling... -->