Add more abstracted VT render tests #4631

Open
opened 2026-01-30 23:52:24 +00:00 by claunia · 0 comments
Owner

Originally created by @zadjii-msft on GitHub (Oct 24, 2019).

I've had a mind to add a test where we just make a Renderer with a Xterm256 engine, then trigger callbacks on the IRenderTarget, and make sure the frame is what we want for a while now that the pieces are tossed apart a bit nicer now, but I've never had the time

The VTRenderTests are not great. I think it'd be better if we could have a test that more simulated "something happened in the console, did we render the right thing?". In the past, the render engines, threads and Renderer were all too coupled to make a easy unittest of it, but as the code's gotten, better, this seems more resonable.

I imagine a test suite that's authored like this:

  1. Create a Renderer with a Xterm256 engine (preferably in the TEST_METHOD_SETUP)
  2. Grab a handle to it's IRenderTarget (preferably in the TEST_METHOD_SETUP)
  3. Do some stuff to the IRenderTarget
  4. Call PaintFrame on the render
  5. Check that the frame painted is what we expected
(from conversation with @DHowett-MSFT)
Originally created by @zadjii-msft on GitHub (Oct 24, 2019). > I've had a mind to add a test where we just make a Renderer with a Xterm256 engine, then trigger callbacks on the IRenderTarget, and make sure the frame is what we want for a while now that the pieces are tossed apart a bit nicer now, but I've never had the time The VTRenderTests are _not great_. I think it'd be better if we could have a test that more simulated "something happened in the console, did we render the right thing?". In the past, the render engines, threads and Renderer were all too coupled to make a easy unittest of it, but as the code's gotten, better, this seems more resonable. I imagine a test suite that's authored like this: 1. Create a `Renderer` with a Xterm256 engine (preferably in the `TEST_METHOD_SETUP`) 2. Grab a handle to it's `IRenderTarget` (preferably in the `TEST_METHOD_SETUP`) 3. Do some stuff to the `IRenderTarget` 4. Call `PaintFrame` on the render 5. Check that the frame painted is what we expected ###### (from conversation with @DHowett-MSFT)
claunia added the Issue-TaskProduct-ConptyArea-CodeHealth labels 2026-01-30 23:52:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4631