class SnapshotTestRunner

Captures screenshots and collects logs from an application run.

Integrates with the Application main loop to:

  • Capture screenshots at a specific frame
  • Collect log output during execution
  • Output results as JSON and log files

Public

Constructors

SnapshotTestRunner

SnapshotTestRunner(const SnapshotTestConfiguration &configuration)

Creates and initializes a snapshot test runner.

configuration
Configuration from command-line arguments.

Methods

~SnapshotTestRunner

~SnapshotTestRunner()

PrepareForScreenCapture

void PrepareForScreenCapture()

If redraw is required this frame, prepares all cameras for screen capture by forcing a redraw.

Must be called before rendering when a capture is pending to ensure on-demand cameras produce a fresh frame for the screenshot.

RequestScreenCapture

void RequestScreenCapture()

If redraw is required this frame, queues a screen capture request.

Must be called after rendering to ensure the screenshot captures the latest frame.

Finalize

void Finalize()

Called from Application::EndMainLoop() to finalize results.

Private

Methods

SaveScreenshot

bool SaveScreenshot(const SPtr<PixelData> &pixelData)

Save the captured screenshot to disk.

WriteResultJson

bool WriteResultJson()

Write the result JSON file.

WriteLogFile

bool WriteLogFile()

Write the log file.

OnLogEntry

bool OnLogEntry(const String &message, LogVerbosity verbosity)

Log callback to capture log entries.

Returns: False to allow normal log processing to continue.

Fields

mConfiguration

mResult

mScreenCaptureOp

TAsyncOp<SPtr<PixelData>> mScreenCaptureOp

mStartFrame

u64 mStartFrame

mExitAfterNFrames

u64 mExitAfterNFrames

mStartTimeUs

u64 mStartTimeUs

mCaptureState

CaptureState mCaptureState