summary refs log tree commit diff
path: root/nixos/tests/pt2-clone.nix
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2020-07-29 19:00:33 +0200
committerFrancesco Gazzetta <fgaz@fgaz.me>2020-07-29 19:45:03 +0200
commit4436c0151e661370f0461b996373bdf7d25cdcbc (patch)
treed6a5f4ee6adf15608e071d14196959c39dcbcaab /nixos/tests/pt2-clone.nix
parent411e09d83c979a37cb5fb63dae7724770e813876 (diff)
downloadnixpkgs-4436c0151e661370f0461b996373bdf7d25cdcbc.tar
nixpkgs-4436c0151e661370f0461b996373bdf7d25cdcbc.tar.gz
nixpkgs-4436c0151e661370f0461b996373bdf7d25cdcbc.tar.bz2
nixpkgs-4436c0151e661370f0461b996373bdf7d25cdcbc.tar.lz
nixpkgs-4436c0151e661370f0461b996373bdf7d25cdcbc.tar.xz
nixpkgs-4436c0151e661370f0461b996373bdf7d25cdcbc.tar.zst
nixpkgs-4436c0151e661370f0461b996373bdf7d25cdcbc.zip
pt2-clone: add nixos test
Diffstat (limited to 'nixos/tests/pt2-clone.nix')
-rw-r--r--nixos/tests/pt2-clone.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/nixos/tests/pt2-clone.nix b/nixos/tests/pt2-clone.nix
new file mode 100644
index 00000000000..b502172e2ee
--- /dev/null
+++ b/nixos/tests/pt2-clone.nix
@@ -0,0 +1,35 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "pt2-clone";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ fgaz ];
+  };
+
+  machine = { config, pkgs, ... }: {
+    imports = [
+      ./common/x11.nix
+    ];
+
+    services.xserver.enable = true;
+    sound.enable = true;
+    environment.systemPackages = [ pkgs.pt2-clone ];
+  };
+
+  enableOCR = true;
+
+  testScript =
+    ''
+      machine.wait_for_x()
+      # Add a dummy sound card, or the program won't start
+      machine.execute("modprobe snd-dummy")
+
+      machine.execute("pt2-clone &")
+
+      machine.wait_for_window(r"ProTracker")
+      machine.sleep(5)
+      # One of the few words that actually get recognized
+      if "LENGTH" not in machine.get_screen_text():
+          raise Exception("Program did not start successfully")
+      machine.screenshot("screen")
+    '';
+})
+