Can I create a headless app with an OpenGL context for my unit tests? #15761
-
I have a set of SkSl shaders for manipulating large images (running on the experimental SkiaSharp 3 support). I want to add tests to ensure the shader output is consistent with a reference software implementation. I set up my XUnit tests as described here. That lets me use Skia's software path, which gets me part of the way there, but what I really need for my tests is a hardware-accelerated GRContext. In my app I can get a shared OpenGL context as described in #13261 and use it for I can always go through the ceremony of manually creating my own OpenGL context, but it would be nice to do it using Avalonia for the current platform. Is there a recommended way to create an OpenGL context for the testing frameworks? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Currently it's not possible, and headless platform doesn't use any hardware acceleration. You can try testing with Appium, basically running a real app with a real window, but whole setup is pretty difficult - https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/Testing/TestableApp.Appium |
Beta Was this translation helpful? Give feedback.
Currently it's not possible, and headless platform doesn't use any hardware acceleration.
You can try testing with Appium, basically running a real app with a real window, but whole setup is pretty difficult - https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/Testing/TestableApp.Appium