How can I instantiate the main Slint component for tests multiple times? #6383
Unanswered
PanCakeConnaisseur
asked this question in
Q&A
Replies: 1 comment
-
The problem is that the platform (Qt or winit) won't allow that. But there is a way: develop your own platform for the test: But there is still a catch that this backend had two entry points: (define in testing/lib.rs)
I think the best option right now is to do "integration" test in their own files so they own get their own process. instead of different thread. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am looking for a way to instantiate the main component multiple times to execute tests.
I have a model struct
Model
that takes a weak reference to theMainWindow
Slint component as a constructor argument like thisLater in tests I have
This fails with
I tried using the serial_test crate and added
#[serial]
before each test, but this time I got:How can I instantiate the main component for tests? I am on Linux, NixOS, KDE, Qt5.
Beta Was this translation helpful? Give feedback.
All reactions