Closed abstralexis closed 3 months ago
Hello! Winit (the window crate we use) needs to run in the main thread. But to run test we don't need winit, you can use notan without winit for testing. Just use the latest version on github (it has a small fix that avoids shader compilation without backend) and run your test with --no-default-features
to remove the backend
feature. You may want to add your own set of features, like draw, log
etc...
Hello, I tried this and I still got the same error. I tried putting the following in my Cargo.toml
:
[patch.crates-io]
notan = { version = "0.11.0", default-features = false, features = ["draw"] }
Like shown in https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html yet I'm still getting the same error.
Would there be any way to set up Graphics
without a notan build that does not require a backend?
Hmm, is there any reason to use [patch.crates-io ]
instead of just cargo dependencies? I think I am missing some info here.
I think a cargo config like this:
[dependencies]
notan = { version = "0.11.0", git = "https://github.com/Nazariglez/notan", branch = "develop" }
[features]
testing = ["notan/log", "notan/draw", "notan/random", "notan/glsl-to-spirv"]
Will work, it will use default features when using the regular build command, and then we can do cargo test with no-default-features
and passing features=testing
to include the basic things you need.
Closing, feel free to reopen if there is still something to discuss. Thanks!
Hello, I am trying to write a test for a struct that I have created - it will eventually be used for loading textures for an engine that I am making. Thus, I am trying to test the initialisation function for sanity. However, I am getting a test fail.
When I run with cargo test, I get a test failure with the message:
Is there a known way to get around this to test functions that act upon structs given by a notan instance?