-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration tests for graphics
#80
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Asks you if you want to create a new model image. * Shows differences when a test fails. * If everything passes, it should close automatically.
`cargo test` crashes for some reason instead of ignoring the test.
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #16 and closes #89.
This PR implements an interactive integration test runner for the
graphics
module.The test runner basically renders a suite of tests off-screen and compares the output with previously generated model images. If differences are detected, the test fails.
Once a new test is added, the runner asks to create a model image:
If differences are detected, the runner allows us to toggle an overlay to check the differences before failing:
If no differences are detected, the runner closes automatically and the test succeeds.
The test is ignored by default and does not run on CI yet. In order to run the test we need to provide the
--ignored
flag tocargo test
:As of now, there is only a simple
Mesh
test implemented, which does not show any differences between Vulkan and OpenGL. Adding tests is really easy though! We should probably do that in another PR.Changelog
Added
Canvas::read_pixels
, which returns aDynamicImage
with the current contents of theCanvas
.ui::Panel
, a widget that represents a box with some content.Changed
UserInterface::react
now takes a mutableWindow
reference, likeGame::interact
. This allows users to render off-screen or toggle fullscreen mode from a UI interaction.Task::run
now takes aGpu
instead of aWindow
. This makes tasks easier to use everywhere. Features like hot asset reloading should be easy with this change.Task::run
does not support progress tracking for now. The old method with progress tracking support is now private and is used exceptionally by theLoadingScreen
trait. This stops users from relying on an unstable interface that will most likely change very soon.