about summary refs log tree commit diff
path: root/nixos/tests/ft2-clone.nix
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2020-07-29 19:40:38 +0200
committerFrancesco Gazzetta <fgaz@fgaz.me>2020-09-07 11:21:26 +0200
commite158d1961823657cc42e43f50be3fd7004e9570c (patch)
treec406700678eae1b512a43bfc6764f5eebd09725c /nixos/tests/ft2-clone.nix
parent78215a8395f4ca1ed801c62a1c4c3e77f2c7d29f (diff)
ft2-clone: add nixos test
Diffstat (limited to 'nixos/tests/ft2-clone.nix')
-rw-r--r--nixos/tests/ft2-clone.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/nixos/tests/ft2-clone.nix b/nixos/tests/ft2-clone.nix
new file mode 100644
index 0000000000000..c877054234ec8
--- /dev/null
+++ b/nixos/tests/ft2-clone.nix
@@ -0,0 +1,35 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "ft2-clone";
+  meta = with pkgs.lib.maintainers; {
+    maintainers = [ fgaz ];
+  };
+
+  machine = { config, pkgs, ... }: {
+    imports = [
+      ./common/x11.nix
+    ];
+
+    services.xserver.enable = true;
+    sound.enable = true;
+    environment.systemPackages = [ pkgs.ft2-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("ft2-clone &")
+
+      machine.wait_for_window(r"Fasttracker")
+      machine.sleep(5)
+      # One of the few words that actually get recognized
+      if "Songlen" not in machine.get_screen_text():
+          raise Exception("Program did not start successfully")
+      machine.screenshot("screen")
+    '';
+})
+