1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00

qt: reduce test closure

This commit is contained in:
Robert Helgesson 2024-12-04 10:24:09 +01:00
parent 8f4f57f9a6
commit 6c3a7a0b72
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
4 changed files with 73 additions and 61 deletions

View file

@ -1,12 +1,10 @@
{
config = {
qt.enable = true;
qt.enable = true;
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
};
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
}

View file

@ -1,27 +1,30 @@
{
config = {
qt = {
enable = true;
# Check if still backwards compatible
platformTheme = "gnome";
style.name = "adwaita";
};
test.stubs.qgnomeplatform = { };
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_QPA_PLATFORMTHEME="gnome"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_STYLE_OVERRIDE="adwaita"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
test.asserts.warnings.expected = [
"The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`."
"The value `gnome` for option `qt.platformTheme` is deprecated. Use `adwaita` instead."
];
qt = {
enable = true;
# Check if still backwards compatible
platformTheme = "gnome";
style.name = "adwaita";
};
test.stubs = {
qgnomeplatform = { };
qgnomeplatform-qt6 = { };
adwaita-qt = { };
adwaita-qt6 = { };
};
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_QPA_PLATFORMTHEME="gnome"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_STYLE_OVERRIDE="adwaita"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
test.asserts.warnings.expected = [
"The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`."
"The value `gnome` for option `qt.platformTheme` is deprecated. Use `adwaita` instead."
];
}

View file

@ -1,18 +1,31 @@
{
config = {
qt = {
enable = true;
platformTheme.name = "gtk";
};
i18n.inputMethod.enabled = "fcitx5";
imports = [ ../../i18n/input-method/fcitx5-stubs.nix ];
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_QPA_PLATFORMTHEME="gtk2"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
qt = {
enable = true;
platformTheme.name = "gtk";
};
i18n.inputMethod.enabled = "fcitx5";
nixpkgs.overlays = [
(final: prev: {
libsForQt5 = prev.libsForQt5.overrideScope (qt5final: qt5prev: {
qtstyleplugins = prev.mkStubPackage { outPath = null; };
});
qt6Packages = prev.qt6Packages.overrideScope (qt6final: qt6prev: {
qt6gtk2 = prev.mkStubPackage { outPath = null; };
});
})
];
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_QPA_PLATFORMTHEME="gtk2"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
}

View file

@ -1,17 +1,15 @@
{
config = {
qt = {
enable = true;
platformTheme.name = "gtk3";
};
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_QPA_PLATFORMTHEME="gtk3"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
qt = {
enable = true;
platformTheme.name = "gtk3";
};
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_QPA_PLATFORMTHEME="gtk3"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
}