Open
Conversation
44e8649 to
82ad67d
Compare
SeaDve
reviewed
Dec 23, 2022
| '--target-dir=@0@'.format(cargo_target_dir), | ||
| '--', | ||
| '--nocapture', | ||
| '--test-threads=1', |
Owner
There was a problem hiding this comment.
Is this still required, even though gtk tests already run single threaded?
Author
There was a problem hiding this comment.
I wouldn't add it if it wasn't needed.
Owner
There was a problem hiding this comment.
I'm still not sure why this is still needed
Author
|
Why is this still not merged? And yes, it’s still relevant. |
https://github.com/gtk-rs/gtk-test#general-setup: > When running test, you need to specify that you only want ONE thread. > Otherwise, GTK contexts might conflict into each others.
There are multiple tests that require schema to be compiled and GSETTINGS_SCHEMA_DIR set, not just the one in settings.rs. The other tests currently fail due to missing schema.
SeaDve
reviewed
Feb 8, 2024
Comment on lines
+54
to
+57
| #[cfg(test)] | ||
| #[macro_use] | ||
| extern crate ctor; | ||
|
|
SeaDve
reviewed
Feb 8, 2024
|
|
||
| #[cfg(test)] | ||
| mod test { | ||
| use ctor; |
SeaDve
reviewed
Feb 8, 2024
| use std::{env, process::Command}; | ||
|
|
||
| // Run once before tests are executed. | ||
| #[ctor] |
Owner
There was a problem hiding this comment.
Suggested change
| #[ctor] | |
| #[ctor::ctor] |
or
use ctor::ctor;
#[ctor]
fn setup_schema() {
...
}
SeaDve
reviewed
Feb 11, 2024
| ], | ||
| env: [ | ||
| 'RUST_BACKTRACE=1', | ||
| 'GSETTINGS_SCHEMA_DIR=@0@/data'.format(meson.project_build_root()), |
Owner
There was a problem hiding this comment.
This shouldn't be needed too since it is set on setup_schema.
Owner
|
Sorry, btw I haven't given this much focus, I have been really busy in other stuff |
Owner
|
Also, not sure what this patch specifically fixes. Is there any particular error? |
This file contains hidden or 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
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.
Now the tests finally pass.
However, it still doesn’t run on CI out-of-box because some of the tests are not unit tests but integration tests utilizing Gtk that require a display. I successfully run it via
xvfb-run, but this provides a virtual X server, not a Wayland server. I haven’t found a similar tool for Wayland yet.Fixes #197.