Skip to content

Explicit tests launching the viewer on every file type it compares - #917

Merged
SimonCropp merged 2 commits into
mainfrom
viewer-file-type-launches
Oct 3, 2026
Merged

SimonCropp merged 2 commits into
mainfrom
viewer-file-type-launches

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Adds explicit tests that launch the viewer built from this working tree on a pair of every file type it compares other than text, so a person can check what each head actually draws. No product code changes.

What it adds

  • FileTypeLaunchTests: 21 explicit cases, one per extension.

    • Images: .png, .bmp, .gif, .ico, .jpg, .jpeg, .webp.
    • A PDF.
    • .docx, .xlsx and .pptx.
    • An SVG.
    • Maps: .geojson, .topojson, .kml, .gpx, .wkt, .kmz, .wkb, .fgb and .geoparquet.
  • What each case does:

    1. Asserts that DiffEngine would route that extension to the viewer.
    2. Writes a received and a verified file that differ visibly.
    3. Prints a checklist of what to look for.
    4. Launches through DiffRunner.LaunchAsync, the path a test run takes, and waits for the window to close.
  • SampleImages builds the images.

    • BMP, ICO and GIF are written by hand, as SamplePng is.
    • JPEG and WebP are encoded with SkiaSharp.
  • Other samples:

    • Office files are the committed samples with one string changed.
    • Maps are made by GeoConvert from one GeoJSON, with the point moved on one side.
  • FileTypeSampleTests is an ordinary test (18 cases) that checks every generated sample on every run:

    • each image is the format and size it claims;
    • each Office edit shows up in the text;
    • every map format draws differently once moved.

    The launch tests are explicit, so without this a broken sample would only show up as an empty window.

Notes

  • The class runs on port 3499 with the tray switched off, as GroupedQueue does. Otherwise a running DiffEngineTray takes each pair into its own queue and shows it in its installed viewer.
  • The class raises MaxInstancesToLaunch, which is 5 by default and would refuse every launch after the fifth.
  • The test project now references GeoConvert, SkiaSharp and SkiaSharp's Linux natives.

Run the class like this. Each window opens after the last one is closed:

dotnet test --project src/DiffEngineViewer.Tests -- --treenode-filter "/*/*/FileTypeLaunchTests/*"

Tests

  • All 21 launch cases pass on Windows. They were run with each window captured and then closed.
  • The viewer test project passes: 495 passed, 13 skipped.

@SimonCropp
SimonCropp merged commit 1aedaab into main Oct 3, 2026
7 of 8 checks passed
@SimonCropp
SimonCropp deleted the viewer-file-type-launches branch October 3, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant