Fix cargo test --all-features breaking rendering due to unity vertexes (#5542)
* Closes #5297 * [x] I have followed the instructions in the PR template It's not great but I wasn't able to come up with a better solution.
This commit is contained in:
parent
bf6ed3adfc
commit
86ea3f8a5c
|
|
@ -238,12 +238,10 @@ jobs:
|
|||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Run tests
|
||||
# TODO(lucasmerlin): Enable --all-features (currently this breaks the rendering in the tests because of the `unity` feature)
|
||||
run: cargo test
|
||||
run: cargo test --all-features
|
||||
|
||||
- name: Run doc-tests
|
||||
# TODO(lucasmerlin): Enable --all-features (currently this breaks the rendering in the tests because of the `unity` feature)
|
||||
run: cargo test --doc
|
||||
run: cargo test --all-features --doc
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ For small things, just go ahead an open a PR. For bigger things, please file an
|
|||
Browse through [`ARCHITECTURE.md`](ARCHITECTURE.md) to get a sense of how all pieces connects.
|
||||
|
||||
You can test your code locally by running `./scripts/check.sh`.
|
||||
There are snapshots test that might need to be updated. Run the tests with `UPDATE_SNAPSHOTS=true` to update them.
|
||||
There are snapshots test that might need to be updated.
|
||||
Run the tests with `UPDATE_SNAPSHOTS=true cargo test --workspace --all-features` to update all of them.
|
||||
For more info about the tests see [egui_kittest](./crates/egui_kittest/README.md).
|
||||
|
||||
We use [git-lfs](https://git-lfs.com/) to store big files in the repository.
|
||||
|
|
|
|||
|
|
@ -74,6 +74,10 @@ serde = ["dep:serde", "epaint/serde", "accesskit?/serde"]
|
|||
## Change Vertex layout to be compatible with unity
|
||||
unity = ["epaint/unity"]
|
||||
|
||||
## Override and disable the unity feature
|
||||
## This exists, so that when testing with --all-features, snapshots render correctly.
|
||||
_override_unity = ["epaint/_override_unity"]
|
||||
|
||||
|
||||
[dependencies]
|
||||
emath = { workspace = true, default-features = false }
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b8ca5a27491c0589a97e43a70bc10dc52778d25ca3f7e7c895dbbbb784adfcfa
|
||||
size 33245
|
||||
oid sha256:0a1099b85a1aaf20f3f1e091bc68259f811737feaefdfcc12acd067eca8f9117
|
||||
size 27083
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:37ba383a2ba7f00f8064d21203c22f9de2f688ea4fbd45d400c979187686cf33
|
||||
size 80861
|
||||
oid sha256:6969c6da67ea6cc7ebbbd7a2cc1cb13d4720befe28126367cbf2b2679d037674
|
||||
size 82363
|
||||
|
|
|
|||
|
|
@ -66,6 +66,10 @@ serde = ["dep:serde", "ahash/serde", "emath/serde", "ecolor/serde"]
|
|||
## Change Vertex layout to be compatible with unity
|
||||
unity = []
|
||||
|
||||
## Override and disable the unity feature
|
||||
## This exists, so that when testing with --all-features, snapshots render correctly.
|
||||
_override_unity = []
|
||||
|
||||
[dependencies]
|
||||
emath.workspace = true
|
||||
ecolor.workspace = true
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use emath::{Pos2, Rect, Rot2, TSTransform, Vec2};
|
|||
/// Should be friendly to send to GPU as is.
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
#[cfg(not(feature = "unity"))]
|
||||
#[cfg(any(not(feature = "unity"), feature = "_override_unity"))]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
|
||||
pub struct Vertex {
|
||||
|
|
@ -25,7 +25,7 @@ pub struct Vertex {
|
|||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
#[cfg(feature = "unity")]
|
||||
#[cfg(all(feature = "unity", not(feature = "_override_unity")))]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
|
||||
pub struct Vertex {
|
||||
|
|
|
|||
Loading…
Reference in New Issue