RFH: winetest testing

Ferenc Wagner wferi at afavant.elte.hu
Mon Apr 26 18:11:46 CDT 2004

Eric Pouech <pouech-eric at wanadoo.fr> writes:

> Ferenc Wagner a écrit :
>> Eric Pouech <pouech-eric at wanadoo.fr> writes:
>>>> The second part, yes.  But winetest must have been made
>>>> into a console app, so it pops up a console when it
>>>> starts.
>>> why do you need a console?
>> Er, I don't know.  Winetest itself doesn't really need it,
>> but WinRash (the service) couldn't execute it otherwise.
> so you mean, that the service (winrash) couldn't start
> winetest if it isn't a cui application (from the PE image
> point of view) ?, or do you mean that winrash wouldn't
> start winetest if winetest isn't attached to a console ?

The first.  Never tried the second, though.  It doesn't
really matter, since -- if I understand it right -- winetest
can't popup its console (like any CUI app) when started by
the service (Chris, is this really the case?), but the
subtests it runs can!  However, recently they are started
with hidden windows and that seems to be enough.

>> We don't understand this.  Apart from this, winetest has
>> console mode, when it doesn't display a gui but logs into
>> its console.  I couldn't find a way to presen gui or
>> console mode based on a command line option (I asked on
>> Win32 programmers' forum, the only solution was XP only.)
> why do you mean by that ?

Transforming a GUI app into CUI by
AttachConsole(ATTACH_PARENT_PROCESS).  Since then somebody
suggested go the other way and restart the CUI process with
the DETACHED_PROCESS flag to get rid of the console.  Not
clean, and we wouldn't gain much: putting up with a console
window isn't the worst thing in life after all.  And ppl
running the service wouldn't even see this.

>>> either you don't care about the output to the console, or
>>> you do care but you've already redirected the output to a
>>> log file so, passing DETACHED_PROCESS in CreateProcess
>>> (winetest/main.c) would be a good thing IMO
>> The individual tests started by winetest don't pop up
>> additional consoles, and their output is redirected.  When
>> started from the service, winetest doesn't pop one up
>> either (of course).  If you can think of a better solution,
>> I'm all ears.
> as I said, we would be better of, if winetest would create
> the process for the tests with the DETACHED_PROCESS
> flag. As you redirect output from child to parent, you
> don't care about stdout/stderr going to the console
> itself, and tests actually requiring a console care about
> creating it, so you should be all set

The output redirection didn't work from a GUI app: the libc
streams weren't initialized and thus the output disappeared.
Wouldn't DETACHED_PROCESS result the same?  It's not crucial
for winetest itself, but making it a console app helped
debugging tremendously.

In short, I've got the impression that things are working
out now (by using some black magic -- ie. winetest being a
CUI -- which I don't understand), so maybe we could simply
leave it for now.  Or do I miss serious issues?

More information about the wine-devel mailing list