diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 8386219f73d8..ff2549395a0b 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -611,6 +611,7 @@ in { searx = handleTest ./searx.nix {}; service-runner = handleTest ./service-runner.nix {}; sfxr-qt = handleTest ./sfxr-qt.nix {}; + sgtpuzzles = handleTest ./sgtpuzzles.nix {}; shadow = handleTest ./shadow.nix {}; shadowsocks = handleTest ./shadowsocks {}; shattered-pixel-dungeon = handleTest ./shattered-pixel-dungeon.nix {}; diff --git a/nixos/tests/sgtpuzzles.nix b/nixos/tests/sgtpuzzles.nix new file mode 100644 index 000000000000..b8d25d42d312 --- /dev/null +++ b/nixos/tests/sgtpuzzles.nix @@ -0,0 +1,34 @@ +import ./make-test-python.nix ({ pkgs, ...} : +{ + name = "sgtpuzzles"; + meta = with pkgs.lib.maintainers; { + maintainers = [ tomfitzhenry ]; + }; + + nodes.machine = { ... }: + + { + imports = [ + ./common/x11.nix + ]; + + services.xserver.enable = true; + environment.systemPackages = with pkgs; [ + sgtpuzzles + ]; + }; + + enableOCR = true; + + testScript = { nodes, ... }: + '' + start_all() + machine.wait_for_x() + + machine.execute("mines >&2 &") + + machine.wait_for_window("Mines") + machine.wait_for_text("Marked") + machine.screenshot("mines") + ''; +}) diff --git a/pkgs/games/sgt-puzzles/default.nix b/pkgs/games/sgt-puzzles/default.nix index 28151972fe26..bf378cd188de 100644 --- a/pkgs/games/sgt-puzzles/default.nix +++ b/pkgs/games/sgt-puzzles/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, desktop-file-utils , gtk3, libX11, cmake, imagemagick -, pkg-config, perl, wrapGAppsHook +, pkg-config, perl, wrapGAppsHook, nixosTests , isMobile ? false }: @@ -59,6 +59,8 @@ stdenv.mkDerivation rec { install -Dm644 ${sgt-puzzles-menu} -t $out/etc/xdg/menus/applications-merged/ ''; + passthru.tests.sgtpuzzles = nixosTests.sgtpuzzles; + meta = with lib; { description = "Simon Tatham's portable puzzle collection"; license = licenses.mit;