XRay

pipeline status

Screenshot testing for Rust games

Features

Example test (for a Piston + OpenGL app):

```rust

[test]

fn checkbasicscreen() { let size = [1280, 720]; let mut app = App::new(size, buildglutinwindow(size)); let Size { width: drawwidth, height: drawheight } = app.window.drawsize(); let Size { width, height } = app.window.size(); app.renderintoviewport(Viewport { rect: [0, 0, drawwidth as i32, drawheight as i32], windowsize: [width, height], drawsize: [drawwidth, drawheight] }); xray::screenshottest("basicrendering/initialmap", 0, 0, drawwidth, drawheight); } ```

Usage

  1. Write your test.
  2. Run your test.
  3. The first time the test will fail, as there is no reference screenshot. The actual screenshot taken during the test will be stored at test_output/<test_name>/actual.png.
  4. Verify the generated screenshot is correct.
  5. Copy the generated screenshot to references/<test_name>.png
  6. Continue development.
  7. If you break the application such that the test no longer renders the same output, the test will fail and the following files will be produced:

Known Issues