summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2021-11-13 23:00:20 +0100
committerFrancesco Gazzetta <fgaz@fgaz.me>2021-11-13 23:00:20 +0100
commitdf99f2326ee60ea5e44ecea403f92d98313e1a1f (patch)
treee93543275cb9e60c6951dec7938ce266278e575e
parentdf177cf39b6d9e1a10967079cb32970401d91a25 (diff)
downloadnixpkgs-df99f2326ee60ea5e44ecea403f92d98313e1a1f.tar
nixpkgs-df99f2326ee60ea5e44ecea403f92d98313e1a1f.tar.gz
nixpkgs-df99f2326ee60ea5e44ecea403f92d98313e1a1f.tar.bz2
nixpkgs-df99f2326ee60ea5e44ecea403f92d98313e1a1f.tar.lz
nixpkgs-df99f2326ee60ea5e44ecea403f92d98313e1a1f.tar.xz
nixpkgs-df99f2326ee60ea5e44ecea403f92d98313e1a1f.tar.zst
nixpkgs-df99f2326ee60ea5e44ecea403f92d98313e1a1f.zip
nixosTests.domination: init
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/domination.nix26
-rw-r--r--pkgs/games/domination/default.nix5
3 files changed, 32 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 0ee91ebffbe..deed04697de 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -109,6 +109,7 @@ in
   docker-tools-overlay = handleTestOn ["x86_64-linux"] ./docker-tools-overlay.nix {};
   documize = handleTest ./documize.nix {};
   dokuwiki = handleTest ./dokuwiki.nix {};
+  domination = handleTest ./domination.nix {};
   dovecot = handleTest ./dovecot.nix {};
   ec2-config = (handleTestOn ["x86_64-linux"] ./ec2.nix {}).boot-ec2-config or {};
   ec2-nixops = (handleTestOn ["x86_64-linux"] ./ec2.nix {}).boot-ec2-nixops or {};
diff --git a/nixos/tests/domination.nix b/nixos/tests/domination.nix
new file mode 100644
index 00000000000..c76d4ed8c61
--- /dev/null
+++ b/nixos/tests/domination.nix
@@ -0,0 +1,26 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "domination";
+  meta = with pkgs.lib.maintainers; {
+    maintainers = [ fgaz ];
+  };
+
+  machine = { config, pkgs, ... }: {
+    imports = [
+      ./common/x11.nix
+    ];
+
+    services.xserver.enable = true;
+    environment.systemPackages = [ pkgs.domination ];
+  };
+
+  enableOCR = true;
+
+  testScript =
+    ''
+      machine.wait_for_x()
+      machine.execute("domination >&2 &")
+      machine.wait_for_window("Menu")
+      machine.wait_for_text("New Game")
+      machine.screenshot("screen")
+    '';
+})
diff --git a/pkgs/games/domination/default.nix b/pkgs/games/domination/default.nix
index e73b563c0af..0dde8ab1641 100644
--- a/pkgs/games/domination/default.nix
+++ b/pkgs/games/domination/default.nix
@@ -6,6 +6,7 @@
 , ant
 , makeWrapper
 , makeDesktopItem
+, nixosTests
 }:
 
 let
@@ -79,6 +80,10 @@ in stdenv.mkDerivation {
     install -Dm644 build/game/resources/icon.png $out/share/pixmaps/domination.png
   '';
 
+  passthru.tests = {
+    domination-starts = nixosTests.domination;
+  };
+
   meta = with lib; {
     homepage = "http://domination.sourceforge.net/";
     downloadPage = "http://domination.sourceforge.net/download.shtml";