-
Notifications
You must be signed in to change notification settings - Fork 52
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
Tests that make a notan instance fail, winit "Initializing the event loop outside of the main thread is a significant cross-platform compatibility hazard" #301
Comments
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 |
Hello, I tried this and I still got the same error. I tried putting the following in my [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. |
Hmm, is there any reason to use I think a cargo config like this:
Will work, it will use default features when using the regular build command, and then we can do cargo test with |
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?
The text was updated successfully, but these errors were encountered: