Merge pull request #103733 from JJJollyjim/term-tests

authored by Sandro and committed by GitHub bf783752 a6a8886d

+322 -16
+1
nixos/tests/all-tests.nix
··· 521 521 telegraf = handleTest ./telegraf.nix {}; 522 522 teleport = handleTest ./teleport.nix {}; 523 523 thelounge = handleTest ./thelounge.nix {}; 524 + terminal-emulators = handleTest ./terminal-emulators.nix {}; 524 525 tiddlywiki = handleTest ./tiddlywiki.nix {}; 525 526 tigervnc = handleTest ./tigervnc.nix {}; 526 527 timezone = handleTest ./timezone.nix {};
+207
nixos/tests/terminal-emulators.nix
··· 1 + # Terminal emulators all present a pretty similar interface. 2 + # That gives us an opportunity to easily test their basic functionality with a single codebase. 3 + # 4 + # There are two tests run on each terminal emulator 5 + # - can it successfully execute a command passed on the cmdline? 6 + # - can it successfully display a colour? 7 + # the latter is used as a proxy for "can it display text?", without going through all the intricacies of OCR. 8 + # 9 + # 256-colour terminal mode is used to display the test colour, since it has a universally-applicable palette (unlike 8- and 16- colour, where the colours are implementation-defined), and it is widely supported (unlike 24-bit colour). 10 + # 11 + # Future work: 12 + # - Wayland support (both for testing the existing terminals, and for testing wayland-only terminals like foot and havoc) 13 + # - Test keyboard input? (skipped for now, to eliminate the possibility of race conditions and focus issues) 14 + 15 + { system ? builtins.currentSystem, 16 + config ? {}, 17 + pkgs ? import ../.. { inherit system config; } 18 + }: 19 + 20 + with import ../lib/testing-python.nix { inherit system pkgs; }; 21 + with pkgs.lib; 22 + 23 + let tests = { 24 + alacritty.pkg = p: p.alacritty; 25 + 26 + contour.pkg = p: p.contour; 27 + contour.cmd = "contour $command"; 28 + 29 + cool-retro-term.pkg = p: p.cool-retro-term; 30 + cool-retro-term.colourTest = false; # broken by gloss effect 31 + 32 + ctx.pkg = p: p.ctx; 33 + ctx.pinkValue = "#FE0065"; 34 + 35 + darktile.pkg = p: p.darktile; 36 + 37 + eterm.pkg = p: p.eterm; 38 + eterm.executable = "Eterm"; 39 + eterm.pinkValue = "#D40055"; 40 + 41 + germinal.pkg = p: p.germinal; 42 + 43 + gnome-terminal.pkg = p: p.gnome.gnome-terminal; 44 + 45 + guake.pkg = p: p.guake; 46 + guake.cmd = "SHELL=$command guake --show"; 47 + guake.kill = true; 48 + 49 + hyper.pkg = p: p.hyper; 50 + 51 + kermit.pkg = p: p.kermit-terminal; 52 + 53 + kgx.pkg = p: p.kgx; 54 + kgx.cmd = "kgx -e $command"; 55 + kgx.kill = true; 56 + 57 + kitty.pkg = p: p.kitty; 58 + kitty.cmd = "kitty $command"; 59 + 60 + konsole.pkg = p: p.plasma5Packages.konsole; 61 + 62 + lxterminal.pkg = p: p.lxterminal; 63 + 64 + mate-terminal.pkg = p: p.mate.mate-terminal; 65 + mate-terminal.cmd = "SHELL=$command mate-terminal --disable-factory"; # factory mode uses dbus, and we don't have a proper dbus session set up 66 + 67 + mlterm.pkg = p: p.mlterm; 68 + 69 + mrxvt.pkg = p: p.mrxvt; 70 + 71 + qterminal.pkg = p: p.lxqt.qterminal; 72 + qterminal.kill = true; 73 + 74 + roxterm.pkg = p: p.roxterm; 75 + roxterm.cmd = "roxterm -e $command"; 76 + 77 + sakura.pkg = p: p.sakura; 78 + 79 + st.pkg = p: p.st; 80 + st.kill = true; 81 + 82 + stupidterm.pkg = p: p.stupidterm; 83 + stupidterm.cmd = "stupidterm -- $command"; 84 + 85 + terminator.pkg = p: p.terminator; 86 + terminator.cmd = "terminator -e $command"; 87 + 88 + terminology.pkg = p: p.enlightenment.terminology; 89 + terminology.cmd = "SHELL=$command terminology --no-wizard=true"; 90 + terminology.colourTest = false; # broken by gloss effect 91 + 92 + termite.pkg = p: p.termite; 93 + 94 + termonad.pkg = p: p.termonad; 95 + 96 + tilda.pkg = p: p.tilda; 97 + 98 + tilix.pkg = p: p.tilix; 99 + tilix.cmd = "tilix -e $command"; 100 + 101 + urxvt.pkg = p: p.rxvt-unicode; 102 + 103 + wayst.pkg = p: p.wayst; 104 + wayst.pinkValue = "#FF0066"; 105 + 106 + wezterm.pkg = p: p.wezterm; 107 + 108 + xfce4-terminal.pkg = p: p.xfce.xfce4-terminal; 109 + 110 + xterm.pkg = p: p.xterm; 111 + }; 112 + in mapAttrs (name: { pkg, executable ? name, cmd ? "SHELL=$command ${executable}", colourTest ? true, pinkValue ? "#FF0087", kill ? false }: makeTest 113 + { 114 + name = "terminal-emulator-${name}"; 115 + meta = with pkgs.stdenv.lib.maintainers; { 116 + maintainers = [ jjjollyjim ]; 117 + }; 118 + 119 + machine = { pkgsInner, ... }: 120 + 121 + { 122 + imports = [ ./common/x11.nix ./common/user-account.nix ]; 123 + 124 + # Hyper (and any other electron-based terminals) won't run as root 125 + test-support.displayManager.auto.user = "alice"; 126 + 127 + environment.systemPackages = [ 128 + (pkg pkgs) 129 + (pkgs.writeShellScriptBin "report-success" '' 130 + echo 1 > /tmp/term-ran-successfully 131 + ${optionalString kill "pkill ${executable}"} 132 + '') 133 + (pkgs.writeShellScriptBin "display-colour" '' 134 + # A 256-colour background colour code for pink, then spaces. 135 + # 136 + # Background is used rather than foreground to minimize the effect of anti-aliasing. 137 + # 138 + # Keep adding more in case the window is partially offscreen to the left or requires 139 + # a change to correctly redraw after initialising the window (as with ctx). 140 + 141 + while : 142 + do 143 + echo -ne "\e[48;5;198m " 144 + sleep 0.5 145 + done 146 + sleep infinity 147 + '') 148 + (pkgs.writeShellScriptBin "run-in-this-term" "sudo -u alice run-in-this-term-wrapped $1") 149 + 150 + (pkgs.writeShellScriptBin "run-in-this-term-wrapped" "command=\"$(which \"$1\")\"; ${cmd}") 151 + ]; 152 + 153 + # Helpful reminder to add this test to passthru.tests 154 + warnings = if !((pkg pkgs) ? "passthru" && (pkg pkgs).passthru ? "tests") then [ "The package for ${name} doesn't have a passthru.tests" ] else [ ]; 155 + }; 156 + 157 + # We need imagemagick, though not tesseract 158 + enableOCR = true; 159 + 160 + testScript = { nodes, ... }: let 161 + in '' 162 + with subtest("wait for x"): 163 + start_all() 164 + machine.wait_for_x() 165 + 166 + with subtest("have the terminal run a command"): 167 + # We run this command synchronously, so we can be certain the exit codes are happy 168 + machine.${if kill then "execute" else "succeed"}("run-in-this-term report-success") 169 + machine.wait_for_file("/tmp/term-ran-successfully") 170 + ${optionalString colourTest '' 171 + 172 + import tempfile 173 + import subprocess 174 + 175 + 176 + def check_for_pink(final=False) -> bool: 177 + with tempfile.NamedTemporaryFile() as tmpin: 178 + machine.send_monitor_command("screendump {}".format(tmpin.name)) 179 + 180 + cmd = 'convert {} -define histogram:unique-colors=true -format "%c" histogram:info:'.format( 181 + tmpin.name 182 + ) 183 + ret = subprocess.run(cmd, shell=True, capture_output=True) 184 + if ret.returncode != 0: 185 + raise Exception( 186 + "image analysis failed with exit code {}".format(ret.returncode) 187 + ) 188 + 189 + text = ret.stdout.decode("utf-8") 190 + return "${pinkValue}" in text 191 + 192 + 193 + with subtest("ensuring no pink is present without the terminal"): 194 + assert ( 195 + check_for_pink() == False 196 + ), "Pink was present on the screen before we even launched a terminal!" 197 + 198 + with subtest("have the terminal display a colour"): 199 + # We run this command in the background 200 + machine.shell.send(b"(run-in-this-term display-colour |& systemd-cat -t terminal) &\n") 201 + 202 + with machine.nested("Waiting for the screen to have pink on it:"): 203 + retry(check_for_pink) 204 + ''}''; 205 + } 206 + 207 + ) tests
+3 -1
pkgs/applications/kde/konsole.nix
··· 1 1 { 2 - mkDerivation, lib, 2 + mkDerivation, lib, nixosTests, 3 3 extra-cmake-modules, kdoctools, 4 4 kbookmarks, kcompletion, kconfig, kconfigwidgets, kcoreaddons, kguiaddons, 5 5 ki18n, kiconthemes, kinit, kio, knotifications, ··· 21 21 kguiaddons ki18n kiconthemes kinit kio knotifications knotifyconfig kparts kpty 22 22 kservice ktextwidgets kwidgetsaddons kwindowsystem kxmlgui qtscript knewstuff 23 23 ]; 24 + 25 + passthru.tests.test = nixosTests.terminal-emulators.konsole; 24 26 25 27 propagatedUserEnvPkgs = [ (lib.getBin kinit) ]; 26 28 }
+3
pkgs/applications/terminal-emulators/alacritty/default.nix
··· 3 3 , fetchFromGitHub 4 4 , fetchpatch 5 5 , rustPlatform 6 + , nixosTests 6 7 7 8 , cmake 8 9 , gzip ··· 131 132 ''; 132 133 133 134 dontPatchELF = true; 135 + 136 + passthru.tests.test = nixosTests.terminal-emulators.alacritty; 134 137 135 138 meta = with lib; { 136 139 description = "A cross-platform, GPU-accelerated terminal emulator";
+3 -1
pkgs/applications/terminal-emulators/contour/default.nix
··· 1 - { lib, stdenv, mkDerivation, fetchFromGitHub, cmake, pkg-config, freetype, libGL, pcre }: 1 + { lib, stdenv, mkDerivation, fetchFromGitHub, cmake, pkg-config, freetype, libGL, pcre, nixosTests }: 2 2 3 3 mkDerivation rec { 4 4 pname = "contour"; ··· 15 15 nativeBuildInputs = [ cmake pkg-config ]; 16 16 17 17 buildInputs = [ freetype libGL pcre ]; 18 + 19 + passthru.tests.test = nixosTests.terminal-emulators.contour; 18 20 19 21 meta = with lib; { 20 22 description = "Modern C++ Terminal Emulator";
+3 -1
pkgs/applications/terminal-emulators/cool-retro-term/default.nix
··· 1 1 { lib, stdenv, fetchFromGitHub, mkDerivation, qtbase, qtquick1, qmltermwidget 2 - , qtquickcontrols, qtgraphicaleffects, qmake }: 2 + , qtquickcontrols, qtgraphicaleffects, qmake, nixosTests }: 3 3 4 4 mkDerivation rec { 5 5 version = "1.1.1"; ··· 28 28 '' + lib.optionalString stdenv.isDarwin '' 29 29 ln -s $out/bin/cool-retro-term.app/Contents/MacOS/cool-retro-term $out/bin/cool-retro-term 30 30 ''; 31 + 32 + passthru.tests.test = nixosTests.terminal-emulators.cool-retro-term; 31 33 32 34 meta = { 33 35 description = "Terminal emulator which mimics the old cathode display";
+3
pkgs/applications/terminal-emulators/ctx/default.nix
··· 8 8 , libdrm # Not documented 9 9 , pkg-config 10 10 , enableFb ? false 11 + , nixosTests 11 12 }: 12 13 13 14 stdenv.mkDerivation rec { ··· 42 43 installFlags = [ 43 44 "PREFIX=${placeholder "out"}" 44 45 ]; 46 + 47 + passthru.tests.test = nixosTests.terminal-emulators.ctx; 45 48 46 49 meta = with lib; { 47 50 homepage = "https://ctx.graphics/";
+3
pkgs/applications/terminal-emulators/darktile/default.nix
··· 12 12 , libXext 13 13 , libXxf86vm 14 14 , libGL 15 + , nixosTests 15 16 }: 16 17 17 18 stdenv.mkDerivation rec { ··· 56 57 57 58 runHook postInstall 58 59 ''; 60 + 61 + passthru.tests.test = nixosTests.terminal-emulators.darktile; 59 62 60 63 meta = with lib; { 61 64 description = "A GPU rendered terminal emulator designed for tiling window managers";
+3
pkgs/applications/terminal-emulators/eterm/default.nix
··· 8 8 , libXext 9 9 , libast 10 10 , pkg-config 11 + , nixosTests 11 12 }: 12 13 13 14 stdenv.mkDerivation rec { ··· 32 33 libXext 33 34 libast 34 35 ]; 36 + 37 + passthru.tests.test = nixosTests.terminal-emulators.eterm; 35 38 36 39 meta = with lib; { 37 40 homepage = "https://github.com/mej/Eterm"; # http://www.eterm.org is gone
+3
pkgs/applications/terminal-emulators/germinal/default.nix
··· 9 9 , tmux 10 10 , vte 11 11 , wrapGAppsHook 12 + , nixosTests 12 13 }: 13 14 14 15 stdenv.mkDerivation rec { ··· 44 45 "''${gappsWrapperArgs[@]}" 45 46 runHook postFixup 46 47 ''; 48 + 49 + passthru.tests.test = nixosTests.terminal-emulators.germinal; 47 50 48 51 meta = with lib; { 49 52 description = "A minimal terminal emulator";
+3
pkgs/applications/terminal-emulators/guake/default.nix
··· 10 10 , libutempter 11 11 , vte 12 12 , libwnck 13 + , nixosTests 13 14 }: 14 15 15 16 python3.pkgs.buildPythonApplication rec { ··· 65 66 preFixup = '' 66 67 gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libutempter ]}") 67 68 ''; 69 + 70 + passthru.tests.test = nixosTests.terminal-emulators.guake; 68 71 69 72 meta = with lib; { 70 73 description = "Drop-down terminal for GNOME";
+3 -1
pkgs/applications/terminal-emulators/hyper/default.nix
··· 2 2 , freetype, fontconfig, dbus, libXi, libXcursor, libXdamage, libXrandr, libXcomposite 3 3 , libXext, libXfixes, libXrender, libX11, libXtst, libXScrnSaver, libxcb, nss, nspr 4 4 , alsa-lib, cups, expat, udev, libpulseaudio, at-spi2-atk, at-spi2-core, libxshmfence 5 - , libdrm, libxkbcommon, mesa }: 5 + , libdrm, libxkbcommon, mesa, nixosTests}: 6 6 7 7 let 8 8 libPath = lib.makeLibraryPath [ ··· 42 42 substituteInPlace $out/share/applications/hyper.desktop \ 43 43 --replace "/opt/Hyper/hyper" "hyper" 44 44 ''; 45 + 46 + passthru.tests.test = nixosTests.terminal-emulators.hyper; 45 47 46 48 dontPatchELF = true; 47 49 meta = with lib; {
+3
pkgs/applications/terminal-emulators/kermit-terminal/default.nix
··· 6 6 , pcre 7 7 , pkg-config 8 8 , vte 9 + , nixosTests 9 10 }: 10 11 11 12 stdenv.mkDerivation rec { ··· 30 31 pcre 31 32 vte 32 33 ]; 34 + 35 + passthru.tests.test = nixosTests.terminal-emulators.kermit; 33 36 34 37 meta = with lib; { 35 38 homepage = "https://github.com/orhun/kermit";
+3
pkgs/applications/terminal-emulators/kgx/default.nix
··· 18 18 , python3 19 19 , sassc 20 20 , wrapGAppsHook 21 + , nixosTests 21 22 }: 22 23 23 24 stdenv.mkDerivation { ··· 65 66 substituteInPlace $out/share/applications/org.gnome.zbrown.KingsCross.desktop \ 66 67 --replace "Exec=kgx" "Exec=$out/bin/kgx" 67 68 ''; 69 + 70 + passthru.tests.test = nixosTests.terminal-emulators.kgx; 68 71 69 72 meta = with lib; { 70 73 description = "Simple user-friendly terminal emulator for the GNOME desktop";
+3
pkgs/applications/terminal-emulators/kitty/default.nix
··· 22 22 , zsh 23 23 , fish 24 24 , fetchpatch 25 + , nixosTests 25 26 }: 26 27 27 28 with python3Packages; ··· 175 176 176 177 runHook postInstall 177 178 ''; 179 + 180 + passthru.tests.test = nixosTests.terminal-emulators.kitty; 178 181 179 182 meta = with lib; { 180 183 homepage = "https://github.com/kovidgoyal/kitty";
+3 -1
pkgs/applications/terminal-emulators/lxterminal/default.nix
··· 1 1 { lib, stdenv, fetchFromGitHub, automake, autoconf, intltool, pkg-config, gtk3, vte, wrapGAppsHook 2 - , libxslt, docbook_xml_dtd_412, docbook_xsl, libxml2, findXMLCatalogs 2 + , libxslt, docbook_xml_dtd_412, docbook_xsl, libxml2, findXMLCatalogs, nixosTests 3 3 }: 4 4 5 5 stdenv.mkDerivation rec { ··· 34 34 ''; 35 35 36 36 doCheck = true; 37 + 38 + passthru.tests.test = nixosTests.terminal-emulators.lxterminal; 37 39 38 40 meta = { 39 41 description = "The standard terminal emulator of LXDE";
+3 -1
pkgs/applications/terminal-emulators/mlterm/default.nix
··· 1 - { stdenv, lib, fetchFromGitHub, pkg-config, autoconf, makeDesktopItem 1 + { stdenv, lib, fetchFromGitHub, pkg-config, autoconf, makeDesktopItem, nixosTests 2 2 , libX11, gdk-pixbuf, cairo, libXft, gtk3, vte 3 3 , harfbuzz #substituting glyphs with opentype fonts 4 4 , fribidi, m17n_lib #bidi and encoding ··· 109 109 categories = [ "Application" "System" "TerminalEmulator" ]; 110 110 startupNotify = false; 111 111 }; 112 + 113 + passthru.tests.test = nixosTests.terminal-emulators.mlterm; 112 114 113 115 meta = with lib; { 114 116 description = "Multi Lingual TERMinal emulator";
+3
pkgs/applications/terminal-emulators/mrxvt/default.nix
··· 10 10 , freetype 11 11 , pkg-config 12 12 , which 13 + , nixosTests 13 14 }: 14 15 15 16 stdenv.mkDerivation rec { ··· 37 38 preConfigure = '' 38 39 NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype.dev}/include/freetype2"; 39 40 ''; 41 + 42 + passthru.tests.test = nixosTests.terminal-emulators.mrxvt; 40 43 41 44 meta = with lib; { 42 45 description = "Lightweight multitabbed feature-rich X11 terminal emulator";
+3 -1
pkgs/applications/terminal-emulators/roxterm/default.nix
··· 1 1 { at-spi2-core, cmake, dbus, dbus-glib, docbook_xsl, libepoxy, fetchFromGitHub 2 2 , glib, gtk3, harfbuzz, libXdmcp, libXtst, libpthreadstubs 3 3 , libselinux, libsepol, libtasn1, libxkbcommon, libxslt, p11-kit, pcre2 4 - , pkg-config, lib, stdenv, util-linuxMinimal, vte, wrapGAppsHook, xmlto 4 + , pkg-config, lib, stdenv, util-linuxMinimal, vte, wrapGAppsHook, xmlto, nixosTests 5 5 }: 6 6 7 7 stdenv.mkDerivation rec { ··· 22 22 util-linuxMinimal glib docbook_xsl xmlto libselinux 23 23 libsepol libxkbcommon libepoxy at-spi2-core libXtst libtasn1 p11-kit 24 24 ]; 25 + 26 + passthru.tests.test = nixosTests.terminal-emulators.roxterm; 25 27 26 28 meta = with lib; { 27 29 homepage = "https://github.com/realh/roxterm";
+3
pkgs/applications/terminal-emulators/rxvt-unicode/default.nix
··· 7 7 , gdkPixbufSupport ? true 8 8 , unicode3Support ? true 9 9 , emojiSupport ? false 10 + , nixosTests 10 11 }: 11 12 12 13 let ··· 101 102 echo "$terminfo" >> $out/nix-support/propagated-user-env-packages 102 103 cp -r ${desktopItem}/share/applications/ $out/share/ 103 104 ''; 105 + 106 + passthru.tests.test = nixosTests.terminal-emulators.urxvt; 104 107 105 108 meta = { 106 109 inherit description;
+5 -1
pkgs/applications/terminal-emulators/rxvt-unicode/wrapper.nix
··· 5 5 , rxvt-unicode-unwrapped 6 6 , rxvt-unicode-plugins 7 7 , perlPackages 8 + , nixosTests 8 9 , configure ? { availablePlugins, ... }: 9 10 { plugins = builtins.attrValues availablePlugins; 10 11 extraDeps = [ ]; ··· 51 52 --suffix-each URXVT_PERL_LIB ':' "$out/lib/urxvt/perl" 52 53 ''; 53 54 54 - passthru.plugins = plugins; 55 + passthru = { 56 + plugins = plugins; 57 + tests.test = nixosTests.terminal-emulators.urxvt; 58 + }; 55 59 }; 56 60 57 61 in
+3
pkgs/applications/terminal-emulators/sakura/default.nix
··· 9 9 , perl 10 10 , pkg-config 11 11 , vte 12 + , nixosTests 12 13 }: 13 14 14 15 stdenv.mkDerivation rec { ··· 42 43 wrapProgram $out/bin/sakura \ 43 44 --suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/ 44 45 ''; 46 + 47 + passthru.tests.test = nixosTests.terminal-emulators.sakura; 45 48 46 49 meta = with lib; { 47 50 homepage = "https://www.pleyades.net/david/projects/sakura";
+3
pkgs/applications/terminal-emulators/st/default.nix
··· 11 11 , conf ? null 12 12 , patches ? [ ] 13 13 , extraLibs ? [ ] 14 + , nixosTests 14 15 }: 15 16 16 17 stdenv.mkDerivation rec { ··· 54 55 ''; 55 56 56 57 installFlags = [ "PREFIX=$(out)" ]; 58 + 59 + passthru.tests.test = nixosTests.terminal-emulators.st; 57 60 58 61 meta = with lib; { 59 62 homepage = "https://st.suckless.org/";
+3 -1
pkgs/applications/terminal-emulators/stupidterm/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, pkg-config, vte, gtk, pcre2 }: 1 + { lib, stdenv, fetchFromGitHub, pkg-config, vte, gtk, pcre2, nixosTests }: 2 2 3 3 stdenv.mkDerivation { 4 4 pname = "stupidterm"; ··· 25 25 substituteInPlace $out/share/applications/stupidterm.desktop \ 26 26 --replace "Exec=st" "Exec=$out/bin/stupidterm" 27 27 ''; 28 + 29 + passthru.tests.test = nixosTests.terminal-emulators.stupidterm; 28 30 29 31 meta = with lib; { 30 32 description = "Simple wrapper around the VTE terminal emulator widget for GTK";
+3
pkgs/applications/terminal-emulators/terminator/default.nix
··· 9 9 , libnotify 10 10 , wrapGAppsHook 11 11 , vte 12 + , nixosTests 12 13 }: 13 14 14 15 python3.pkgs.buildPythonApplication rec { ··· 61 62 preFixup = '' 62 63 makeWrapperArgs+=("''${gappsWrapperArgs[@]}") 63 64 ''; 65 + 66 + passthru.tests.test = nixosTests.terminal-emulators.terminator; 64 67 65 68 meta = with lib; { 66 69 description = "Terminal emulator with support for tiling and tabs";
+5 -2
pkgs/applications/terminal-emulators/termite/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, vte, gtk3, ncurses, pcre2, wrapGAppsHook }: 1 + { lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, vte, gtk3, ncurses, pcre2, wrapGAppsHook, nixosTests }: 2 2 3 3 let 4 4 ··· 57 57 58 58 outputs = [ "out" "terminfo" ]; 59 59 60 - passthru = { inherit vte-ng; }; 60 + passthru = { 61 + inherit vte-ng; 62 + tests = nixosTests.terminal-emulators.termite; 63 + }; 61 64 62 65 postInstall = '' 63 66 mkdir -p $terminfo/share
+3 -1
pkgs/applications/terminal-emulators/termonad/default.nix
··· 1 - { stdenv, haskellPackages, makeWrapper, packages ? (pkgSet: []) }: 1 + { stdenv, haskellPackages, makeWrapper, packages ? (pkgSet: []), nixosTests }: 2 2 3 3 let 4 4 termonadEnv = haskellPackages.ghcWithPackages (self: [ self.termonad ] ++ packages self); ··· 16 16 # trivial derivation 17 17 preferLocalBuild = true; 18 18 allowSubstitutes = false; 19 + 20 + passthru.tests.test = nixosTests.terminal-emulators.termonad; 19 21 20 22 meta = haskellPackages.termonad.meta // { 21 23 mainProgram = "termonad";
+3
pkgs/applications/terminal-emulators/tilda/default.nix
··· 9 9 , pcre2 10 10 , vte 11 11 , makeWrapper 12 + , nixosTests 12 13 }: 13 14 14 15 stdenv.mkDerivation rec { ··· 41 42 makeWrapper "$out/bin/wrapped/tilda" "$out/bin/tilda" \ 42 43 --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" 43 44 ''; 45 + 46 + passthru.tests.test = nixosTests.terminal-emulators.tilda; 44 47 45 48 meta = with lib; { 46 49 description = "A Gtk based drop down terminal for Linux and Unix";
+3
pkgs/applications/terminal-emulators/tilix/default.nix
··· 17 17 , wrapGAppsHook 18 18 , libunwind 19 19 , appstream 20 + , nixosTests 20 21 }: 21 22 22 23 stdenv.mkDerivation rec { ··· 65 66 substituteInPlace $out/share/applications/com.gexperts.Tilix.desktop \ 66 67 --replace "Exec=tilix" "Exec=$out/bin/tilix" 67 68 ''; 69 + 70 + passthru.tests.test = nixosTests.terminal-emulators.tilix; 68 71 69 72 meta = with lib; { 70 73 description = "Tiling terminal emulator following the Gnome Human Interface Guidelines";
+3
pkgs/applications/terminal-emulators/wayst/default.nix
··· 2 2 , lib 3 3 , fetchFromGitHub 4 4 , pkg-config 5 + , nixosTests 5 6 , freetype 6 7 , fontconfig 7 8 , libGL ··· 77 78 ln -s ${desktopItem}/share/applications/* $out/share/applications 78 79 install -D icons/wayst.svg $out/share/icons/hicolor/scalable/apps/wayst.svg 79 80 ''; 81 + 82 + passthru.tests.test = nixosTests.terminal-emulators.wayst; 80 83 81 84 meta = with lib; { 82 85 description = "A simple terminal emulator";
+3
pkgs/applications/terminal-emulators/wezterm/default.nix
··· 22 22 , Cocoa 23 23 , Foundation 24 24 , libiconv 25 + , nixosTests 25 26 }: 26 27 27 28 rustPlatform.buildRustPackage rec { ··· 98 99 cp -r assets/shell-integration/* "$OUT_APP" 99 100 ln -s $out/bin/{wezterm,wezterm-mux-server,wezterm-gui,strip-ansi-escapes} "$OUT_APP" 100 101 ''; 102 + 103 + passthru.tests.test = nixosTests.terminal-emulators.wezterm; 101 104 102 105 meta = with lib; { 103 106 description = "A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust";
+4 -1
pkgs/applications/terminal-emulators/xterm/default.nix
··· 76 76 ''; 77 77 78 78 passthru = { 79 - tests = { inherit (nixosTests) xterm; }; 79 + tests = { 80 + customTest = nixosTests.xterm; 81 + standardTest = nixosTests.terminal-emulators.xterm; 82 + }; 80 83 81 84 updateScript = let 82 85 # Tags that end in letters are unstable
+3 -1
pkgs/desktops/enlightenment/terminology/default.nix
··· 1 - { lib, stdenv, fetchurl, meson, ninja, pkg-config, python3, efl }: 1 + { lib, stdenv, fetchurl, meson, ninja, pkg-config, python3, efl, nixosTests }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "terminology"; ··· 23 23 postPatch = '' 24 24 patchShebangs data/colorschemes/*.py 25 25 ''; 26 + 27 + passthru.tests.test = nixosTests.terminal-emulators.terminology; 26 28 27 29 meta = with lib; { 28 30 description = "Powerful terminal emulator based on EFL";
+3
pkgs/desktops/gnome/core/gnome-terminal/default.nix
··· 23 23 , pcre2 24 24 , libxslt 25 25 , docbook-xsl-nons 26 + , nixosTests 26 27 }: 27 28 28 29 stdenv.mkDerivation rec { ··· 81 82 attrPath = "gnome.gnome-terminal"; 82 83 }; 83 84 }; 85 + 86 + passthru.tests.test = nixosTests.terminal-emulators.gnome-terminal; 84 87 85 88 meta = with lib; { 86 89 description = "The GNOME Terminal Emulator";
+3
pkgs/desktops/lxqt/qterminal/default.nix
··· 8 8 , qttools 9 9 , qtx11extras 10 10 , lxqtUpdateScript 11 + , nixosTests 11 12 }: 12 13 13 14 mkDerivation rec { ··· 34 35 ]; 35 36 36 37 passthru.updateScript = lxqtUpdateScript { inherit pname version src; }; 38 + 39 + passthru.tests.test = nixosTests.terminal-emulators.qterminal; 37 40 38 41 meta = with lib; { 39 42 homepage = "https://github.com/lxqt/qterminal";
+3 -1
pkgs/desktops/mate/mate-terminal/default.nix
··· 1 - { lib, stdenv, fetchurl, pkg-config, gettext, itstool, libxml2, mate-desktop, dconf, vte, pcre2, wrapGAppsHook, mateUpdateScript }: 1 + { lib, stdenv, fetchurl, pkg-config, gettext, itstool, libxml2, mate-desktop, dconf, vte, pcre2, wrapGAppsHook, mateUpdateScript, nixosTests }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "mate-terminal"; ··· 27 27 enableParallelBuilding = true; 28 28 29 29 passthru.updateScript = mateUpdateScript { inherit pname version; }; 30 + 31 + passthru.tests.test = nixosTests.terminal-emulators.mate-terminal; 30 32 31 33 meta = with lib; { 32 34 description = "MATE desktop terminal emulator";
+3 -1
pkgs/desktops/xfce/applications/xfce4-terminal/default.nix
··· 1 - { lib, mkXfceDerivation, gtk3, libxfce4ui, vte, xfconf, pcre2, libxslt, docbook_xml_dtd_45, docbook_xsl }: 1 + { lib, mkXfceDerivation, gtk3, libxfce4ui, vte, xfconf, pcre2, libxslt, docbook_xml_dtd_45, docbook_xsl, nixosTests }: 2 2 3 3 mkXfceDerivation { 4 4 category = "apps"; ··· 10 10 nativeBuildInputs = [ libxslt docbook_xml_dtd_45 docbook_xsl ]; 11 11 12 12 buildInputs = [ gtk3 libxfce4ui vte xfconf pcre2 ]; 13 + 14 + passthru.tests.test = nixosTests.terminal-emulators.xfce4-terminal; 13 15 14 16 meta = with lib; { 15 17 description = "A modern terminal emulator";
+4
pkgs/development/libraries/vte/default.nix
··· 22 22 , icu 23 23 , systemd 24 24 , systemdSupport ? stdenv.hostPlatform.isLinux 25 + , nixosTests 25 26 }: 26 27 27 28 stdenv.mkDerivation rec { ··· 90 91 updateScript = gnome.updateScript { 91 92 packageName = pname; 92 93 versionPolicy = "odd-unstable"; 94 + }; 95 + tests = { 96 + inherit (nixosTests.terminal-emulators) gnome-terminal lxterminal mlterm roxterm sakura stupidterm terminator termite xfce4-terminal; 93 97 }; 94 98 }; 95 99