about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2022-11-24 20:46:05 +0100
committerFrancesco Gazzetta <fgaz@fgaz.me>2022-11-24 20:48:42 +0100
commitcc0182e2d1796351802f19703be1926fc9e1656f (patch)
treee7cf7d97e43ba3e2a6d427ba0cdd4ca689c79bc0 /nixos/tests
parent533eaa27814ac31d7c049018ccb002b3d6c06653 (diff)
nixosTests.warzone2100: init
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/warzone2100.nix26
2 files changed, 27 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 1fa5b0b1c13d8..bb3d50d9a78cb 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -689,6 +689,7 @@ in {
   virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
   vscodium = discoverTests (import ./vscodium.nix);
   vsftpd = handleTest ./vsftpd.nix {};
+  warzone2100 = handleTest ./warzone2100.nix {};
   wasabibackend = handleTest ./wasabibackend.nix {};
   wiki-js = handleTest ./wiki-js.nix {};
   wine = handleTest ./wine.nix {};
diff --git a/nixos/tests/warzone2100.nix b/nixos/tests/warzone2100.nix
new file mode 100644
index 0000000000000..568e04a46999d
--- /dev/null
+++ b/nixos/tests/warzone2100.nix
@@ -0,0 +1,26 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "warzone2100";
+  meta = with pkgs.lib.maintainers; {
+    maintainers = [ fgaz ];
+  };
+
+  nodes.machine = { config, pkgs, ... }: {
+    imports = [
+      ./common/x11.nix
+    ];
+
+    services.xserver.enable = true;
+    environment.systemPackages = [ pkgs.warzone2100 ];
+  };
+
+  enableOCR = true;
+
+  testScript =
+    ''
+      machine.wait_for_x()
+      machine.execute("warzone2100 >&2 &")
+      machine.wait_for_window("Warzone 2100")
+      machine.wait_for_text(r"(Single Player|Multi Player|Tutorial|Options|Quit Game)")
+      machine.screenshot("screen")
+    '';
+})