Alexandre Julliard wrote:
Eric Pouech Eric.Pouech@wanadoo.fr writes:
Do you really feel like a C compiler is less common than a perl binary under Windows ? I seriously doubt it...
Anybody can install a perl binary on their machine, while nearly all Windows compilers are commercial software...
I know at least two free compilers... lcc and mingw to me the greatest obstable is to maintain the build environments for all the possible compilers (MSVC, Borland...)
there's just one point that worries me. Let me explain how I ended up with XML. one thing I don't like is to have a "reference" file, but I don't know what it refers to. I think the test process should output both the result of the test (pure ASCII is fine) but also the environment of the test (Windows - if so version, even DLLs used... -, vs wine - which version, which DLLs are used, native vs builtin...) so that we could make usefull comparisons
But none of this information is relevant for unit testing. The only information that may be needed is the Windows version, and this only for the few APIs that actually behave differently between versions. And if you do your test scripts right you don't even need to know about it. For instance, instead of doing something like:
kernel32->MapViewOfFile(bad params); print kernel32->GetLastError();
which would print different things on 95 and NT, you'd do:
kernel32->MapViewOfFile(bad params); $err = kernel32->GetLastError(); if (kernel32->GetVersion() == win95) { print ($err == ERROR_INVALID_ADDRESS) ? "OK" : "failed: $err"; } else { print ($err == ERROR_INVALID_PARAMETER) ? "OK" : "failed: $err"; }
This way the script always prints the same thing no matter the Windows version, and you can use a simple diff against a single reference file.
this is utterly true for low level APIs (like kernel) however, testing a highler level API will depend on all the others DLL the tested DLL depends on... and here you may introduce some discrepencies...
A+