WineHQ
WineHQ

5.3. Running the tests in Wine

The simplest way to run the tests in Wine is to type 'make test' in the Wine sources top level directory. This will run all the Wine conformance tests.

The tests for a specific Wine library are located in a 'tests' subdirectory of the library directory. Each test is contained in a file (e.g. dlls/kernel32/tests/thread.c). Each file itself contains many checks concerning one or more related APIs.

So to run all the tests related to a given Wine library, go to the corresponding tests directory and type make test. This will compile the tests, run them, and create a xxx.ok file for each test that passes successfully. And if you only want to run the tests contained in the thread.c file of the kernel library, you would do:

$ cd dlls/kernel32/tests
$ make thread.ok

Note that if the test has already been run and is up to date (i.e. if neither the kernel library nor the thread.c file has changed since the thread.ok file was created), then make will say so. To force the test to be re-run, delete the thread.ok file, and run the make command again.

You can also run tests manually using a command similar to the following:

$ ../../../tools/runtest -q -M kernel32.dll -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 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.