SNSystems / dexter

DExTer - Debug Experience Tester
MIT License
33 stars 6 forks source link

Set SUBSYSTEM:WINDOWS as the default environment on Windows #54

Closed OCHyams closed 5 years ago

OCHyams commented 5 years ago

At the moment a console window is created when a DExTer test case is started up for debugging on Windows. This is an undesirable default behaviour because the test cases will steal focus every time they are run.

The default subsystem for programs with a 'main' entry point is CONSOLE. Linking with /SUBSYSTEM:WINDOWS means the application will not create a console when it runs.

/ENTRY:mainCRTStartup is now required because setting /SUBSYSTEM:WINDOWS tells the linker to look for 'WinMain' by default instead of 'main'.

These compiler flags are overridable by providing them explicitly through DExTer's --cflags and --ldflags.

gregbedwell commented 5 years ago

Nice!

OCHyams commented 5 years ago

At the moment we only 'support' testing on Linux but I suppose I could still write tests for this (with the idea that they will be run one day). Tests would definitely make me feel more comfortable. Anyone else have an opinion on this?

jmorse commented 5 years ago

Sounds good to me; the existing tests all work with this right? I suspect this isn't something we can actually test works because it involves knowing whether or not a popup is produced.

OCHyams commented 5 years ago

I suspect this isn't something we can actually test works because it involves knowing whether or not a popup is produced.

Yeah, I was thinking we can test that overriding the flags in different combinations produces the same DExTer score (this also checks that the compile and link is successful).

jmorse commented 5 years ago

Cool; that might be a good addition too (perhaps hard to script in lit?), but IMO this is well worth merging right now, without objection I'll do that in a couple of hours.

OCHyams commented 5 years ago

Fixed a weirdly consistent typo subsytem->subsystem.