On Fri, 29 Mar 2002, Eric Pouech wrote:
Francois Gouget a écrit :
On Fri, 29 Mar 2002, Eric Pouech wrote: For the parameter testing I was thinking of storing the expected argv parameters in environment variables. Then, we need a way to tell the child to do specific tests (maybe one more environment variable) and it would then compare the contents of the environment variables with what it got.
But since we do not control the main/WinMain, we would have to rely on getmainargs or __argv, __argp tricks (which means parts of the test may only be possible in msvcrt).
I don't follow you... we got access to main (what is missing is just letting the test procs access argc/argv pair
True. So what we need is to add a function in the testing framework so that tests can get argc/argv/envp. Seems like a reasonable approach.
I decided to let the parent do the checking because:
- you don't know what the stdout of the child will be (and if you'll be able to get the results on the console)
It should have the same stdout as the parent, unless you explicitely nuke them when calling CreateProcess.
- make process depends on result of the parent for success/failure
Yes, the child should have an exit code that indicates success and another one that indicates failure. The parent checks that and returns success or failure as appropriate.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ Linux, WinNT, MS-DOS - also known as the Good, the Bad and the Ugly.