Michael Mc Donnell
Email: <michael AT SPAMFREE mcdonnell DOT dk>
Tips For Writing Graphical Tests
Do not emit accelerators(e.g. Alt-M)as keystrokes. Key accelerators are dependent on the locale and the test can break on machines with different locales. Use the corresponding WM_COMMAND instead.
Standalone Tests using Visual Studio 2008
Standalone tests can be compiled and run using Microsoft Visual Studio 2008 on Windows. The following steps are needed to get up and running:
- Create an empty project in VS2008, e.g. called mytest.
- Add a c-file with the test name, e.g. mytest.c
Download the latest test.h file.
- Create a folder called wine in the project.
- Move the file test.h to the folder wine.
- Right click on the project, e.g. mytest, and select Properties.
- Expand the Configuration Properties branch.
- Expand the C/C++ branch.
- Select the Preprocessor leaf.
Click the field Preprocessor Definitions and add the following text(without the quotes): "inline=__inline;STANDALONE"
- Click OK.
Make sure to add #include <windows.h> before #include "wine/test.h". A test template could be:
#include <windows.h> #include "wine/test.h" void first_test(void) { ok(TRUE, "A good failure message."); } START_TEST(mystest) { first_test(); }
The project should now be set up to compile a single standalone test.
