Terminal.Gui icon indicating copy to clipboard operation
Terminal.Gui copied to clipboard

Add AOT version of Tests

Open tig opened this issue 6 months ago • 10 comments

Each of the Test projects should have a AOT version.

It should be possible to create e.g., ./Tests/UnitTests.AOT that links to all the tests in ./Tests/UnitTests but has project settings enabling AOT.

We should also have the same for each project in /Examples.

tig avatar May 29 '25 17:05 tig

@BDisp - What are your thoughts on doing this?

tig avatar Jun 04 '25 18:06 tig

I don't think I can handle that responsibility. I'd rather you write it yourself and I'll give you all the help I can within the limits of my knowledge, if you don't mind.

BDisp avatar Jun 04 '25 18:06 BDisp

I don't think I can handle that responsibility. I'd rather you write it yourself and I'll give you all the help I can within the limits of my knowledge, if you don't mind.

I have no idea how to do it.

tig avatar Jun 04 '25 18:06 tig

I have no idea how to do it.

I thought you already had some idea. In that case I will try to work out some solution. However, the most reliable test is always in release mode, because in debug mode we can't always detect incompatibilities.

BDisp avatar Jun 04 '25 18:06 BDisp

My only thought is i really hope there's a way to do it where the new projects don't copy any code, but somehow link to the other non AOT test projects.

tig avatar Jun 04 '25 20:06 tig

We should also have the same for each project in /Examples.

I agree, but I would create a ExampleWindow.cs file with the public class ExampleWindow : Window in the Example project and link it to the NativeAot and SelfContained projects, removing duplicated code. The NativeAot and SelfContained projects should maintain as is because already handle with trimmed compilation. Only the CommunityToolkitExample, Example, and ReactiveExample projects may worth create a .AOT project for each one. What's your opinions?

BDisp avatar Jun 08 '25 18:06 BDisp

NetDriver and v2net are rendering badly the Button only in Windows.

Image

Image

BDisp avatar Jun 08 '25 22:06 BDisp

But what is odd is that the output variable is correct. Thus it seems that the Console.Write or the Windows Terminal isn't rendering well the output.

Image

Image

BDisp avatar Jun 08 '25 22:06 BDisp

I found the issue. The Examples projects aren't using Console.OutputEncoding = System.Text.Encoding.UTF8; which is needed for NetDriver. Win32 API perhaps assume the UTF8 encoding, I think.

Image

BDisp avatar Jun 09 '25 00:06 BDisp

With conhost.exe and cmd.exe using the CaskaydiaCove NFM font doesn't render well all color schema:

Image

Only with the JetBrainsMono NFM font all glyphs are rendered well with all color schema:

Image

BDisp avatar Jun 09 '25 12:06 BDisp