nixosTests.noto-fonts-cjk-qt-default-weight: init
This commit is contained in:
parent
25c1820914
commit
f4385d6010
2 changed files with 31 additions and 0 deletions
|
@ -487,6 +487,7 @@ in {
|
|||
nomad = handleTest ./nomad.nix {};
|
||||
non-default-filesystems = handleTest ./non-default-filesystems.nix {};
|
||||
noto-fonts = handleTest ./noto-fonts.nix {};
|
||||
noto-fonts-cjk-qt-default-weight = handleTest ./noto-fonts-cjk-qt-default-weight.nix {};
|
||||
novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};
|
||||
nscd = handleTest ./nscd.nix {};
|
||||
nsd = handleTest ./nsd.nix {};
|
||||
|
|
30
nixos/tests/noto-fonts-cjk-qt-default-weight.nix
Normal file
30
nixos/tests/noto-fonts-cjk-qt-default-weight.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||
name = "noto-fonts-cjk-qt";
|
||||
meta.maintainers = with lib.maintainers; [ oxalica ];
|
||||
|
||||
nodes.machine = {
|
||||
imports = [ ./common/x11.nix ];
|
||||
fonts = {
|
||||
enableDefaultFonts = false;
|
||||
fonts = [ pkgs.noto-fonts-cjk-sans ];
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
let
|
||||
script = pkgs.writers.writePython3 "qt-default-weight" {
|
||||
libraries = [ pkgs.python3Packages.pyqt6 ];
|
||||
} ''
|
||||
from PyQt6.QtWidgets import QApplication
|
||||
from PyQt6.QtGui import QFont, QRawFont
|
||||
|
||||
app = QApplication([])
|
||||
f = QRawFont.fromFont(QFont("Noto Sans CJK SC", 20))
|
||||
|
||||
assert f.styleName() == "Regular", f.styleName()
|
||||
'';
|
||||
in ''
|
||||
machine.wait_for_x()
|
||||
machine.succeed("${script}")
|
||||
'';
|
||||
})
|
Loading…
Reference in a new issue