diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b2b35119ce35..423a6bd1e4a6 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -521,6 +521,7 @@ in telegraf = handleTest ./telegraf.nix {}; teleport = handleTest ./teleport.nix {}; thelounge = handleTest ./thelounge.nix {}; + terminal-emulators = handleTest ./terminal-emulators.nix {}; tiddlywiki = handleTest ./tiddlywiki.nix {}; tigervnc = handleTest ./tigervnc.nix {}; timezone = handleTest ./timezone.nix {}; diff --git a/nixos/tests/terminal-emulators.nix b/nixos/tests/terminal-emulators.nix new file mode 100644 index 000000000000..60161b80b965 --- /dev/null +++ b/nixos/tests/terminal-emulators.nix @@ -0,0 +1,207 @@ +# Terminal emulators all present a pretty similar interface. +# That gives us an opportunity to easily test their basic functionality with a single codebase. +# +# There are two tests run on each terminal emulator +# - can it successfully execute a command passed on the cmdline? +# - can it successfully display a colour? +# the latter is used as a proxy for "can it display text?", without going through all the intricacies of OCR. +# +# 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). +# +# Future work: +# - Wayland support (both for testing the existing terminals, and for testing wayland-only terminals like foot and havoc) +# - Test keyboard input? (skipped for now, to eliminate the possibility of race conditions and focus issues) + +{ system ? builtins.currentSystem, + config ? {}, + pkgs ? import ../.. { inherit system config; } +}: + +with import ../lib/testing-python.nix { inherit system pkgs; }; +with pkgs.lib; + +let tests = { + alacritty.pkg = p: p.alacritty; + + contour.pkg = p: p.contour; + contour.cmd = "contour $command"; + + cool-retro-term.pkg = p: p.cool-retro-term; + cool-retro-term.colourTest = false; # broken by gloss effect + + ctx.pkg = p: p.ctx; + ctx.pinkValue = "#FE0065"; + + darktile.pkg = p: p.darktile; + + eterm.pkg = p: p.eterm; + eterm.executable = "Eterm"; + eterm.pinkValue = "#D40055"; + + germinal.pkg = p: p.germinal; + + gnome-terminal.pkg = p: p.gnome.gnome-terminal; + + guake.pkg = p: p.guake; + guake.cmd = "SHELL=$command guake --show"; + guake.kill = true; + + hyper.pkg = p: p.hyper; + + kermit.pkg = p: p.kermit-terminal; + + kgx.pkg = p: p.kgx; + kgx.cmd = "kgx -e $command"; + kgx.kill = true; + + kitty.pkg = p: p.kitty; + kitty.cmd = "kitty $command"; + + konsole.pkg = p: p.plasma5Packages.konsole; + + lxterminal.pkg = p: p.lxterminal; + + mate-terminal.pkg = p: p.mate.mate-terminal; + mate-terminal.cmd = "SHELL=$command mate-terminal --disable-factory"; # factory mode uses dbus, and we don't have a proper dbus session set up + + mlterm.pkg = p: p.mlterm; + + mrxvt.pkg = p: p.mrxvt; + + qterminal.pkg = p: p.lxqt.qterminal; + qterminal.kill = true; + + roxterm.pkg = p: p.roxterm; + roxterm.cmd = "roxterm -e $command"; + + sakura.pkg = p: p.sakura; + + st.pkg = p: p.st; + st.kill = true; + + stupidterm.pkg = p: p.stupidterm; + stupidterm.cmd = "stupidterm -- $command"; + + terminator.pkg = p: p.terminator; + terminator.cmd = "terminator -e $command"; + + terminology.pkg = p: p.enlightenment.terminology; + terminology.cmd = "SHELL=$command terminology --no-wizard=true"; + terminology.colourTest = false; # broken by gloss effect + + termite.pkg = p: p.termite; + + termonad.pkg = p: p.termonad; + + tilda.pkg = p: p.tilda; + + tilix.pkg = p: p.tilix; + tilix.cmd = "tilix -e $command"; + + urxvt.pkg = p: p.rxvt-unicode; + + wayst.pkg = p: p.wayst; + wayst.pinkValue = "#FF0066"; + + wezterm.pkg = p: p.wezterm; + + xfce4-terminal.pkg = p: p.xfce.xfce4-terminal; + + xterm.pkg = p: p.xterm; + }; +in mapAttrs (name: { pkg, executable ? name, cmd ? "SHELL=$command ${executable}", colourTest ? true, pinkValue ? "#FF0087", kill ? false }: makeTest +{ + name = "terminal-emulator-${name}"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ jjjollyjim ]; + }; + + machine = { pkgsInner, ... }: + + { + imports = [ ./common/x11.nix ./common/user-account.nix ]; + + # Hyper (and any other electron-based terminals) won't run as root + test-support.displayManager.auto.user = "alice"; + + environment.systemPackages = [ + (pkg pkgs) + (pkgs.writeShellScriptBin "report-success" '' + echo 1 > /tmp/term-ran-successfully + ${optionalString kill "pkill ${executable}"} + '') + (pkgs.writeShellScriptBin "display-colour" '' + # A 256-colour background colour code for pink, then spaces. + # + # Background is used rather than foreground to minimize the effect of anti-aliasing. + # + # Keep adding more in case the window is partially offscreen to the left or requires + # a change to correctly redraw after initialising the window (as with ctx). + + while : + do + echo -ne "\e[48;5;198m " + sleep 0.5 + done + sleep infinity + '') + (pkgs.writeShellScriptBin "run-in-this-term" "sudo -u alice run-in-this-term-wrapped $1") + + (pkgs.writeShellScriptBin "run-in-this-term-wrapped" "command=\"$(which \"$1\")\"; ${cmd}") + ]; + + # Helpful reminder to add this test to passthru.tests + warnings = if !((pkg pkgs) ? "passthru" && (pkg pkgs).passthru ? "tests") then [ "The package for ${name} doesn't have a passthru.tests" ] else [ ]; + }; + + # We need imagemagick, though not tesseract + enableOCR = true; + + testScript = { nodes, ... }: let + in '' + with subtest("wait for x"): + start_all() + machine.wait_for_x() + + with subtest("have the terminal run a command"): + # We run this command synchronously, so we can be certain the exit codes are happy + machine.${if kill then "execute" else "succeed"}("run-in-this-term report-success") + machine.wait_for_file("/tmp/term-ran-successfully") + ${optionalString colourTest '' + + import tempfile + import subprocess + + + def check_for_pink(final=False) -> bool: + with tempfile.NamedTemporaryFile() as tmpin: + machine.send_monitor_command("screendump {}".format(tmpin.name)) + + cmd = 'convert {} -define histogram:unique-colors=true -format "%c" histogram:info:'.format( + tmpin.name + ) + ret = subprocess.run(cmd, shell=True, capture_output=True) + if ret.returncode != 0: + raise Exception( + "image analysis failed with exit code {}".format(ret.returncode) + ) + + text = ret.stdout.decode("utf-8") + return "${pinkValue}" in text + + + with subtest("ensuring no pink is present without the terminal"): + assert ( + check_for_pink() == False + ), "Pink was present on the screen before we even launched a terminal!" + + with subtest("have the terminal display a colour"): + # We run this command in the background + machine.shell.send(b"(run-in-this-term display-colour |& systemd-cat -t terminal) &\n") + + with machine.nested("Waiting for the screen to have pink on it:"): + retry(check_for_pink) + ''}''; +} + + ) tests diff --git a/pkgs/applications/kde/konsole.nix b/pkgs/applications/kde/konsole.nix index 098001ef4c23..23cbdf28477d 100644 --- a/pkgs/applications/kde/konsole.nix +++ b/pkgs/applications/kde/konsole.nix @@ -1,5 +1,5 @@ { - mkDerivation, lib, + mkDerivation, lib, nixosTests, extra-cmake-modules, kdoctools, kbookmarks, kcompletion, kconfig, kconfigwidgets, kcoreaddons, kguiaddons, ki18n, kiconthemes, kinit, kio, knotifications, @@ -22,5 +22,7 @@ mkDerivation { kservice ktextwidgets kwidgetsaddons kwindowsystem kxmlgui qtscript knewstuff ]; + passthru.tests.test = nixosTests.terminal-emulators.konsole; + propagatedUserEnvPkgs = [ (lib.getBin kinit) ]; } diff --git a/pkgs/applications/terminal-emulators/alacritty/default.nix b/pkgs/applications/terminal-emulators/alacritty/default.nix index e7730ba4b942..e6762f543cb9 100644 --- a/pkgs/applications/terminal-emulators/alacritty/default.nix +++ b/pkgs/applications/terminal-emulators/alacritty/default.nix @@ -3,6 +3,7 @@ , fetchFromGitHub , fetchpatch , rustPlatform +, nixosTests , cmake , gzip @@ -132,6 +133,8 @@ rustPlatform.buildRustPackage rec { dontPatchELF = true; + passthru.tests.test = nixosTests.terminal-emulators.alacritty; + meta = with lib; { description = "A cross-platform, GPU-accelerated terminal emulator"; homepage = "https://github.com/alacritty/alacritty"; diff --git a/pkgs/applications/terminal-emulators/contour/default.nix b/pkgs/applications/terminal-emulators/contour/default.nix index 6ef16a5b9e48..d0def97e46f3 100644 --- a/pkgs/applications/terminal-emulators/contour/default.nix +++ b/pkgs/applications/terminal-emulators/contour/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, pkg-config, freetype, libGL, pcre }: +{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, pkg-config, freetype, libGL, pcre, nixosTests }: mkDerivation rec { pname = "contour"; @@ -16,6 +16,8 @@ mkDerivation rec { buildInputs = [ freetype libGL pcre ]; + passthru.tests.test = nixosTests.terminal-emulators.contour; + meta = with lib; { description = "Modern C++ Terminal Emulator"; homepage = "https://github.com/christianparpart/contour"; diff --git a/pkgs/applications/terminal-emulators/cool-retro-term/default.nix b/pkgs/applications/terminal-emulators/cool-retro-term/default.nix index 049452c7e3ad..4243502e7fe9 100644 --- a/pkgs/applications/terminal-emulators/cool-retro-term/default.nix +++ b/pkgs/applications/terminal-emulators/cool-retro-term/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, mkDerivation, qtbase, qtquick1, qmltermwidget -, qtquickcontrols, qtgraphicaleffects, qmake }: +, qtquickcontrols, qtgraphicaleffects, qmake, nixosTests }: mkDerivation rec { version = "1.1.1"; @@ -29,6 +29,8 @@ mkDerivation rec { ln -s $out/bin/cool-retro-term.app/Contents/MacOS/cool-retro-term $out/bin/cool-retro-term ''; + passthru.tests.test = nixosTests.terminal-emulators.cool-retro-term; + meta = { description = "Terminal emulator which mimics the old cathode display"; longDescription = '' diff --git a/pkgs/applications/terminal-emulators/ctx/default.nix b/pkgs/applications/terminal-emulators/ctx/default.nix index 78c673d035a0..420e9b020e99 100644 --- a/pkgs/applications/terminal-emulators/ctx/default.nix +++ b/pkgs/applications/terminal-emulators/ctx/default.nix @@ -8,6 +8,7 @@ , libdrm # Not documented , pkg-config , enableFb ? false +, nixosTests }: stdenv.mkDerivation rec { @@ -43,6 +44,8 @@ stdenv.mkDerivation rec { "PREFIX=${placeholder "out"}" ]; + passthru.tests.test = nixosTests.terminal-emulators.ctx; + meta = with lib; { homepage = "https://ctx.graphics/"; description = "Vector graphics terminal"; diff --git a/pkgs/applications/terminal-emulators/darktile/default.nix b/pkgs/applications/terminal-emulators/darktile/default.nix index f63232949501..17af8457cb10 100644 --- a/pkgs/applications/terminal-emulators/darktile/default.nix +++ b/pkgs/applications/terminal-emulators/darktile/default.nix @@ -12,6 +12,7 @@ , libXext , libXxf86vm , libGL +, nixosTests }: stdenv.mkDerivation rec { @@ -57,6 +58,8 @@ stdenv.mkDerivation rec { runHook postInstall ''; + passthru.tests.test = nixosTests.terminal-emulators.darktile; + meta = with lib; { description = "A GPU rendered terminal emulator designed for tiling window managers"; homepage = "https://github.com/liamg/darktile"; diff --git a/pkgs/applications/terminal-emulators/eterm/default.nix b/pkgs/applications/terminal-emulators/eterm/default.nix index 328e61f1fe50..769104fea431 100644 --- a/pkgs/applications/terminal-emulators/eterm/default.nix +++ b/pkgs/applications/terminal-emulators/eterm/default.nix @@ -8,6 +8,7 @@ , libXext , libast , pkg-config +, nixosTests }: stdenv.mkDerivation rec { @@ -33,6 +34,8 @@ stdenv.mkDerivation rec { libast ]; + passthru.tests.test = nixosTests.terminal-emulators.eterm; + meta = with lib; { homepage = "https://github.com/mej/Eterm"; # http://www.eterm.org is gone description = "Terminal emulator"; diff --git a/pkgs/applications/terminal-emulators/germinal/default.nix b/pkgs/applications/terminal-emulators/germinal/default.nix index 1bbe87853f75..aef24f675b1a 100644 --- a/pkgs/applications/terminal-emulators/germinal/default.nix +++ b/pkgs/applications/terminal-emulators/germinal/default.nix @@ -9,6 +9,7 @@ , tmux , vte , wrapGAppsHook +, nixosTests }: stdenv.mkDerivation rec { @@ -45,6 +46,8 @@ stdenv.mkDerivation rec { runHook postFixup ''; + passthru.tests.test = nixosTests.terminal-emulators.germinal; + meta = with lib; { description = "A minimal terminal emulator"; homepage = "https://github.com/Keruspe/Germinal"; diff --git a/pkgs/applications/terminal-emulators/guake/default.nix b/pkgs/applications/terminal-emulators/guake/default.nix index 8c4c6b383d56..cc2dc5c55d61 100644 --- a/pkgs/applications/terminal-emulators/guake/default.nix +++ b/pkgs/applications/terminal-emulators/guake/default.nix @@ -10,6 +10,7 @@ , libutempter , vte , libwnck +, nixosTests }: python3.pkgs.buildPythonApplication rec { @@ -66,6 +67,8 @@ python3.pkgs.buildPythonApplication rec { gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libutempter ]}") ''; + passthru.tests.test = nixosTests.terminal-emulators.guake; + meta = with lib; { description = "Drop-down terminal for GNOME"; homepage = "http://guake-project.org"; diff --git a/pkgs/applications/terminal-emulators/hyper/default.nix b/pkgs/applications/terminal-emulators/hyper/default.nix index a2b3d13b36a8..485c1dead14c 100644 --- a/pkgs/applications/terminal-emulators/hyper/default.nix +++ b/pkgs/applications/terminal-emulators/hyper/default.nix @@ -2,7 +2,7 @@ , freetype, fontconfig, dbus, libXi, libXcursor, libXdamage, libXrandr, libXcomposite , libXext, libXfixes, libXrender, libX11, libXtst, libXScrnSaver, libxcb, nss, nspr , alsa-lib, cups, expat, udev, libpulseaudio, at-spi2-atk, at-spi2-core, libxshmfence -, libdrm, libxkbcommon, mesa }: +, libdrm, libxkbcommon, mesa, nixosTests}: let libPath = lib.makeLibraryPath [ @@ -43,6 +43,8 @@ stdenv.mkDerivation rec { --replace "/opt/Hyper/hyper" "hyper" ''; + passthru.tests.test = nixosTests.terminal-emulators.hyper; + dontPatchELF = true; meta = with lib; { description = "A terminal built on web technologies"; diff --git a/pkgs/applications/terminal-emulators/kermit-terminal/default.nix b/pkgs/applications/terminal-emulators/kermit-terminal/default.nix index 8a5a78564149..da5342aa683f 100644 --- a/pkgs/applications/terminal-emulators/kermit-terminal/default.nix +++ b/pkgs/applications/terminal-emulators/kermit-terminal/default.nix @@ -6,6 +6,7 @@ , pcre , pkg-config , vte +, nixosTests }: stdenv.mkDerivation rec { @@ -31,6 +32,8 @@ stdenv.mkDerivation rec { vte ]; + passthru.tests.test = nixosTests.terminal-emulators.kermit; + meta = with lib; { homepage = "https://github.com/orhun/kermit"; description = "A VTE-based, simple and froggy terminal emulator"; diff --git a/pkgs/applications/terminal-emulators/kgx/default.nix b/pkgs/applications/terminal-emulators/kgx/default.nix index dc5c651d50a5..1be9412e8dae 100644 --- a/pkgs/applications/terminal-emulators/kgx/default.nix +++ b/pkgs/applications/terminal-emulators/kgx/default.nix @@ -18,6 +18,7 @@ , python3 , sassc , wrapGAppsHook +, nixosTests }: stdenv.mkDerivation { @@ -66,6 +67,8 @@ stdenv.mkDerivation { --replace "Exec=kgx" "Exec=$out/bin/kgx" ''; + passthru.tests.test = nixosTests.terminal-emulators.kgx; + meta = with lib; { description = "Simple user-friendly terminal emulator for the GNOME desktop"; homepage = "https://gitlab.gnome.org/ZanderBrown/kgx"; diff --git a/pkgs/applications/terminal-emulators/kitty/default.nix b/pkgs/applications/terminal-emulators/kitty/default.nix index 1e6db04dd76d..d06c6d937c11 100644 --- a/pkgs/applications/terminal-emulators/kitty/default.nix +++ b/pkgs/applications/terminal-emulators/kitty/default.nix @@ -22,6 +22,7 @@ , zsh , fish , fetchpatch +, nixosTests }: with python3Packages; @@ -176,6 +177,8 @@ buildPythonApplication rec { runHook postInstall ''; + passthru.tests.test = nixosTests.terminal-emulators.kitty; + meta = with lib; { homepage = "https://github.com/kovidgoyal/kitty"; description = "A modern, hackable, featureful, OpenGL based terminal emulator"; diff --git a/pkgs/applications/terminal-emulators/lxterminal/default.nix b/pkgs/applications/terminal-emulators/lxterminal/default.nix index 25495a686834..13f4e3c4119e 100644 --- a/pkgs/applications/terminal-emulators/lxterminal/default.nix +++ b/pkgs/applications/terminal-emulators/lxterminal/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, automake, autoconf, intltool, pkg-config, gtk3, vte, wrapGAppsHook -, libxslt, docbook_xml_dtd_412, docbook_xsl, libxml2, findXMLCatalogs +, libxslt, docbook_xml_dtd_412, docbook_xsl, libxml2, findXMLCatalogs, nixosTests }: stdenv.mkDerivation rec { @@ -35,6 +35,8 @@ stdenv.mkDerivation rec { doCheck = true; + passthru.tests.test = nixosTests.terminal-emulators.lxterminal; + meta = { description = "The standard terminal emulator of LXDE"; longDescription = '' diff --git a/pkgs/applications/terminal-emulators/mlterm/default.nix b/pkgs/applications/terminal-emulators/mlterm/default.nix index d84aa984a33b..056a24138441 100644 --- a/pkgs/applications/terminal-emulators/mlterm/default.nix +++ b/pkgs/applications/terminal-emulators/mlterm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, pkg-config, autoconf, makeDesktopItem +{ stdenv, lib, fetchFromGitHub, pkg-config, autoconf, makeDesktopItem, nixosTests , libX11, gdk-pixbuf, cairo, libXft, gtk3, vte , harfbuzz #substituting glyphs with opentype fonts , fribidi, m17n_lib #bidi and encoding @@ -110,6 +110,8 @@ stdenv.mkDerivation rec { startupNotify = false; }; + passthru.tests.test = nixosTests.terminal-emulators.mlterm; + meta = with lib; { description = "Multi Lingual TERMinal emulator"; homepage = "http://mlterm.sourceforge.net/"; diff --git a/pkgs/applications/terminal-emulators/mrxvt/default.nix b/pkgs/applications/terminal-emulators/mrxvt/default.nix index ba6c6ab87c15..006616bd944c 100644 --- a/pkgs/applications/terminal-emulators/mrxvt/default.nix +++ b/pkgs/applications/terminal-emulators/mrxvt/default.nix @@ -10,6 +10,7 @@ , freetype , pkg-config , which +, nixosTests }: stdenv.mkDerivation rec { @@ -38,6 +39,8 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype.dev}/include/freetype2"; ''; + passthru.tests.test = nixosTests.terminal-emulators.mrxvt; + meta = with lib; { description = "Lightweight multitabbed feature-rich X11 terminal emulator"; longDescription = " diff --git a/pkgs/applications/terminal-emulators/roxterm/default.nix b/pkgs/applications/terminal-emulators/roxterm/default.nix index 3e4454726b66..7444a8627b79 100644 --- a/pkgs/applications/terminal-emulators/roxterm/default.nix +++ b/pkgs/applications/terminal-emulators/roxterm/default.nix @@ -1,7 +1,7 @@ { at-spi2-core, cmake, dbus, dbus-glib, docbook_xsl, libepoxy, fetchFromGitHub , glib, gtk3, harfbuzz, libXdmcp, libXtst, libpthreadstubs , libselinux, libsepol, libtasn1, libxkbcommon, libxslt, p11-kit, pcre2 -, pkg-config, lib, stdenv, util-linuxMinimal, vte, wrapGAppsHook, xmlto +, pkg-config, lib, stdenv, util-linuxMinimal, vte, wrapGAppsHook, xmlto, nixosTests }: stdenv.mkDerivation rec { @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { libsepol libxkbcommon libepoxy at-spi2-core libXtst libtasn1 p11-kit ]; + passthru.tests.test = nixosTests.terminal-emulators.roxterm; + meta = with lib; { homepage = "https://github.com/realh/roxterm"; license = licenses.gpl3; diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix index 1ca84149fdd7..0eccceb5a4f6 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix @@ -7,6 +7,7 @@ , gdkPixbufSupport ? true , unicode3Support ? true , emojiSupport ? false +, nixosTests }: let @@ -102,6 +103,8 @@ stdenv.mkDerivation { cp -r ${desktopItem}/share/applications/ $out/share/ ''; + passthru.tests.test = nixosTests.terminal-emulators.urxvt; + meta = { inherit description; homepage = "http://software.schmorp.de/pkg/rxvt-unicode.html"; diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode/wrapper.nix b/pkgs/applications/terminal-emulators/rxvt-unicode/wrapper.nix index 5255d40b9ce2..9fe78e30ae3d 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode/wrapper.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode/wrapper.nix @@ -5,6 +5,7 @@ , rxvt-unicode-unwrapped , rxvt-unicode-plugins , perlPackages +, nixosTests , configure ? { availablePlugins, ... }: { plugins = builtins.attrValues availablePlugins; extraDeps = [ ]; @@ -51,7 +52,10 @@ let --suffix-each URXVT_PERL_LIB ':' "$out/lib/urxvt/perl" ''; - passthru.plugins = plugins; + passthru = { + plugins = plugins; + tests.test = nixosTests.terminal-emulators.urxvt; + }; }; in diff --git a/pkgs/applications/terminal-emulators/sakura/default.nix b/pkgs/applications/terminal-emulators/sakura/default.nix index 8434c233ad4b..52b35ad38ae7 100644 --- a/pkgs/applications/terminal-emulators/sakura/default.nix +++ b/pkgs/applications/terminal-emulators/sakura/default.nix @@ -9,6 +9,7 @@ , perl , pkg-config , vte +, nixosTests }: stdenv.mkDerivation rec { @@ -43,6 +44,8 @@ stdenv.mkDerivation rec { --suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/ ''; + passthru.tests.test = nixosTests.terminal-emulators.sakura; + meta = with lib; { homepage = "https://www.pleyades.net/david/projects/sakura"; description = "A terminal emulator based on GTK and VTE"; diff --git a/pkgs/applications/terminal-emulators/st/default.nix b/pkgs/applications/terminal-emulators/st/default.nix index 35baec9d0e44..efbdc040589f 100644 --- a/pkgs/applications/terminal-emulators/st/default.nix +++ b/pkgs/applications/terminal-emulators/st/default.nix @@ -11,6 +11,7 @@ , conf ? null , patches ? [ ] , extraLibs ? [ ] +, nixosTests }: stdenv.mkDerivation rec { @@ -55,6 +56,8 @@ stdenv.mkDerivation rec { installFlags = [ "PREFIX=$(out)" ]; + passthru.tests.test = nixosTests.terminal-emulators.st; + meta = with lib; { homepage = "https://st.suckless.org/"; description = "Simple Terminal for X from Suckless.org Community"; diff --git a/pkgs/applications/terminal-emulators/stupidterm/default.nix b/pkgs/applications/terminal-emulators/stupidterm/default.nix index 554d210fbdea..279af55254e0 100644 --- a/pkgs/applications/terminal-emulators/stupidterm/default.nix +++ b/pkgs/applications/terminal-emulators/stupidterm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, pkg-config, vte, gtk, pcre2 }: +{ lib, stdenv, fetchFromGitHub, pkg-config, vte, gtk, pcre2, nixosTests }: stdenv.mkDerivation { pname = "stupidterm"; @@ -26,6 +26,8 @@ stdenv.mkDerivation { --replace "Exec=st" "Exec=$out/bin/stupidterm" ''; + passthru.tests.test = nixosTests.terminal-emulators.stupidterm; + meta = with lib; { description = "Simple wrapper around the VTE terminal emulator widget for GTK"; homepage = "https://github.com/esmil/stupidterm"; diff --git a/pkgs/applications/terminal-emulators/terminator/default.nix b/pkgs/applications/terminal-emulators/terminator/default.nix index 67c7196e24da..04d4af0ccaf0 100644 --- a/pkgs/applications/terminal-emulators/terminator/default.nix +++ b/pkgs/applications/terminal-emulators/terminator/default.nix @@ -9,6 +9,7 @@ , libnotify , wrapGAppsHook , vte +, nixosTests }: python3.pkgs.buildPythonApplication rec { @@ -62,6 +63,8 @@ python3.pkgs.buildPythonApplication rec { makeWrapperArgs+=("''${gappsWrapperArgs[@]}") ''; + passthru.tests.test = nixosTests.terminal-emulators.terminator; + meta = with lib; { description = "Terminal emulator with support for tiling and tabs"; longDescription = '' diff --git a/pkgs/applications/terminal-emulators/termite/default.nix b/pkgs/applications/terminal-emulators/termite/default.nix index 96fd3409dc7a..2b05ecdc7221 100644 --- a/pkgs/applications/terminal-emulators/termite/default.nix +++ b/pkgs/applications/terminal-emulators/termite/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, vte, gtk3, ncurses, pcre2, wrapGAppsHook }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, vte, gtk3, ncurses, pcre2, wrapGAppsHook, nixosTests }: let @@ -57,7 +57,10 @@ in stdenv.mkDerivation rec { outputs = [ "out" "terminfo" ]; - passthru = { inherit vte-ng; }; + passthru = { + inherit vte-ng; + tests = nixosTests.terminal-emulators.termite; + }; postInstall = '' mkdir -p $terminfo/share diff --git a/pkgs/applications/terminal-emulators/termonad/default.nix b/pkgs/applications/terminal-emulators/termonad/default.nix index 6a1dd0bec398..111d790c6955 100644 --- a/pkgs/applications/terminal-emulators/termonad/default.nix +++ b/pkgs/applications/terminal-emulators/termonad/default.nix @@ -1,4 +1,4 @@ -{ stdenv, haskellPackages, makeWrapper, packages ? (pkgSet: []) }: +{ stdenv, haskellPackages, makeWrapper, packages ? (pkgSet: []), nixosTests }: let termonadEnv = haskellPackages.ghcWithPackages (self: [ self.termonad ] ++ packages self); @@ -17,6 +17,8 @@ in stdenv.mkDerivation { preferLocalBuild = true; allowSubstitutes = false; + passthru.tests.test = nixosTests.terminal-emulators.termonad; + meta = haskellPackages.termonad.meta // { mainProgram = "termonad"; }; diff --git a/pkgs/applications/terminal-emulators/tilda/default.nix b/pkgs/applications/terminal-emulators/tilda/default.nix index 1ea50cfff7a1..01cc4f527a91 100644 --- a/pkgs/applications/terminal-emulators/tilda/default.nix +++ b/pkgs/applications/terminal-emulators/tilda/default.nix @@ -9,6 +9,7 @@ , pcre2 , vte , makeWrapper +, nixosTests }: stdenv.mkDerivation rec { @@ -42,6 +43,8 @@ stdenv.mkDerivation rec { --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" ''; + passthru.tests.test = nixosTests.terminal-emulators.tilda; + meta = with lib; { description = "A Gtk based drop down terminal for Linux and Unix"; homepage = "https://github.com/lanoxx/tilda/"; diff --git a/pkgs/applications/terminal-emulators/tilix/default.nix b/pkgs/applications/terminal-emulators/tilix/default.nix index 0538a2060aec..917b179490c6 100644 --- a/pkgs/applications/terminal-emulators/tilix/default.nix +++ b/pkgs/applications/terminal-emulators/tilix/default.nix @@ -17,6 +17,7 @@ , wrapGAppsHook , libunwind , appstream +, nixosTests }: stdenv.mkDerivation rec { @@ -66,6 +67,8 @@ stdenv.mkDerivation rec { --replace "Exec=tilix" "Exec=$out/bin/tilix" ''; + passthru.tests.test = nixosTests.terminal-emulators.tilix; + meta = with lib; { description = "Tiling terminal emulator following the Gnome Human Interface Guidelines"; homepage = "https://gnunn1.github.io/tilix-web"; diff --git a/pkgs/applications/terminal-emulators/wayst/default.nix b/pkgs/applications/terminal-emulators/wayst/default.nix index f3751e39881d..eeb258f48c49 100644 --- a/pkgs/applications/terminal-emulators/wayst/default.nix +++ b/pkgs/applications/terminal-emulators/wayst/default.nix @@ -2,6 +2,7 @@ , lib , fetchFromGitHub , pkg-config +, nixosTests , freetype , fontconfig , libGL @@ -78,6 +79,8 @@ stdenv.mkDerivation rec { install -D icons/wayst.svg $out/share/icons/hicolor/scalable/apps/wayst.svg ''; + passthru.tests.test = nixosTests.terminal-emulators.wayst; + meta = with lib; { description = "A simple terminal emulator"; mainProgram = "wayst"; diff --git a/pkgs/applications/terminal-emulators/wezterm/default.nix b/pkgs/applications/terminal-emulators/wezterm/default.nix index ce729fab0276..6d1276035c13 100644 --- a/pkgs/applications/terminal-emulators/wezterm/default.nix +++ b/pkgs/applications/terminal-emulators/wezterm/default.nix @@ -22,6 +22,7 @@ , Cocoa , Foundation , libiconv +, nixosTests }: rustPlatform.buildRustPackage rec { @@ -99,6 +100,8 @@ rustPlatform.buildRustPackage rec { ln -s $out/bin/{wezterm,wezterm-mux-server,wezterm-gui,strip-ansi-escapes} "$OUT_APP" ''; + passthru.tests.test = nixosTests.terminal-emulators.wezterm; + meta = with lib; { description = "A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust"; homepage = "https://wezfurlong.org/wezterm"; diff --git a/pkgs/applications/terminal-emulators/xterm/default.nix b/pkgs/applications/terminal-emulators/xterm/default.nix index 3530b2d1d2f6..278332ca6a36 100644 --- a/pkgs/applications/terminal-emulators/xterm/default.nix +++ b/pkgs/applications/terminal-emulators/xterm/default.nix @@ -76,7 +76,10 @@ stdenv.mkDerivation rec { ''; passthru = { - tests = { inherit (nixosTests) xterm; }; + tests = { + customTest = nixosTests.xterm; + standardTest = nixosTests.terminal-emulators.xterm; + }; updateScript = let # Tags that end in letters are unstable diff --git a/pkgs/desktops/enlightenment/terminology/default.nix b/pkgs/desktops/enlightenment/terminology/default.nix index a2e4f717f481..7b3ffe2f1124 100644 --- a/pkgs/desktops/enlightenment/terminology/default.nix +++ b/pkgs/desktops/enlightenment/terminology/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, meson, ninja, pkg-config, python3, efl }: +{ lib, stdenv, fetchurl, meson, ninja, pkg-config, python3, efl, nixosTests }: stdenv.mkDerivation rec { pname = "terminology"; @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { patchShebangs data/colorschemes/*.py ''; + passthru.tests.test = nixosTests.terminal-emulators.terminology; + meta = with lib; { description = "Powerful terminal emulator based on EFL"; homepage = "https://www.enlightenment.org/about-terminology"; diff --git a/pkgs/desktops/gnome/core/gnome-terminal/default.nix b/pkgs/desktops/gnome/core/gnome-terminal/default.nix index 69fb69261f98..588d6e3ced3a 100644 --- a/pkgs/desktops/gnome/core/gnome-terminal/default.nix +++ b/pkgs/desktops/gnome/core/gnome-terminal/default.nix @@ -23,6 +23,7 @@ , pcre2 , libxslt , docbook-xsl-nons +, nixosTests }: stdenv.mkDerivation rec { @@ -82,6 +83,8 @@ stdenv.mkDerivation rec { }; }; + passthru.tests.test = nixosTests.terminal-emulators.gnome-terminal; + meta = with lib; { description = "The GNOME Terminal Emulator"; homepage = "https://wiki.gnome.org/Apps/Terminal"; diff --git a/pkgs/desktops/lxqt/qterminal/default.nix b/pkgs/desktops/lxqt/qterminal/default.nix index e93e404762a2..9412506385b3 100644 --- a/pkgs/desktops/lxqt/qterminal/default.nix +++ b/pkgs/desktops/lxqt/qterminal/default.nix @@ -8,6 +8,7 @@ , qttools , qtx11extras , lxqtUpdateScript +, nixosTests }: mkDerivation rec { @@ -35,6 +36,8 @@ mkDerivation rec { passthru.updateScript = lxqtUpdateScript { inherit pname version src; }; + passthru.tests.test = nixosTests.terminal-emulators.qterminal; + meta = with lib; { homepage = "https://github.com/lxqt/qterminal"; description = "A lightweight Qt-based terminal emulator"; diff --git a/pkgs/desktops/mate/mate-terminal/default.nix b/pkgs/desktops/mate/mate-terminal/default.nix index 19fa5697f969..fcae87a869ee 100644 --- a/pkgs/desktops/mate/mate-terminal/default.nix +++ b/pkgs/desktops/mate/mate-terminal/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, pkg-config, gettext, itstool, libxml2, mate-desktop, dconf, vte, pcre2, wrapGAppsHook, mateUpdateScript }: +{ lib, stdenv, fetchurl, pkg-config, gettext, itstool, libxml2, mate-desktop, dconf, vte, pcre2, wrapGAppsHook, mateUpdateScript, nixosTests }: stdenv.mkDerivation rec { pname = "mate-terminal"; @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { passthru.updateScript = mateUpdateScript { inherit pname version; }; + passthru.tests.test = nixosTests.terminal-emulators.mate-terminal; + meta = with lib; { description = "MATE desktop terminal emulator"; homepage = "https://mate-desktop.org"; diff --git a/pkgs/desktops/xfce/applications/xfce4-terminal/default.nix b/pkgs/desktops/xfce/applications/xfce4-terminal/default.nix index 4d887f96ffd2..65611f73a1d2 100644 --- a/pkgs/desktops/xfce/applications/xfce4-terminal/default.nix +++ b/pkgs/desktops/xfce/applications/xfce4-terminal/default.nix @@ -1,4 +1,4 @@ -{ lib, mkXfceDerivation, gtk3, libxfce4ui, vte, xfconf, pcre2, libxslt, docbook_xml_dtd_45, docbook_xsl }: +{ lib, mkXfceDerivation, gtk3, libxfce4ui, vte, xfconf, pcre2, libxslt, docbook_xml_dtd_45, docbook_xsl, nixosTests }: mkXfceDerivation { category = "apps"; @@ -11,6 +11,8 @@ mkXfceDerivation { buildInputs = [ gtk3 libxfce4ui vte xfconf pcre2 ]; + passthru.tests.test = nixosTests.terminal-emulators.xfce4-terminal; + meta = with lib; { description = "A modern terminal emulator"; maintainers = with maintainers; [ ] ++ teams.xfce.members; diff --git a/pkgs/development/libraries/vte/default.nix b/pkgs/development/libraries/vte/default.nix index eae934a4ebb1..aae30390ee41 100644 --- a/pkgs/development/libraries/vte/default.nix +++ b/pkgs/development/libraries/vte/default.nix @@ -22,6 +22,7 @@ , icu , systemd , systemdSupport ? stdenv.hostPlatform.isLinux +, nixosTests }: stdenv.mkDerivation rec { @@ -91,6 +92,9 @@ stdenv.mkDerivation rec { packageName = pname; versionPolicy = "odd-unstable"; }; + tests = { + inherit (nixosTests.terminal-emulators) gnome-terminal lxterminal mlterm roxterm sakura stupidterm terminator termite xfce4-terminal; + }; }; meta = with lib; {