diff --git a/tests/modules/misc/qt/qt-basic.nix b/tests/modules/misc/qt/qt-basic.nix index a4cadcb73..d0e8a2c3e 100644 --- a/tests/modules/misc/qt/qt-basic.nix +++ b/tests/modules/misc/qt/qt-basic.nix @@ -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' + ''; } diff --git a/tests/modules/misc/qt/qt-platform-theme-gnome.nix b/tests/modules/misc/qt/qt-platform-theme-gnome.nix index ab65f146a..ca5829ee7 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gnome.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gnome.nix @@ -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." + ]; } diff --git a/tests/modules/misc/qt/qt-platform-theme-gtk.nix b/tests/modules/misc/qt/qt-platform-theme-gtk.nix index 76a6512f8..22107016c 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gtk.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gtk.nix @@ -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' + ''; } diff --git a/tests/modules/misc/qt/qt-platform-theme-gtk3.nix b/tests/modules/misc/qt/qt-platform-theme-gtk3.nix index 264088186..e55ad0be6 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gtk3.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gtk3.nix @@ -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' + ''; }