summary refs log tree commit diff
path: root/nixos/tests/pt2-clone.nix
blob: b502172e2ee5eb4cb492dab85b0d4e586f299356 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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")
    '';
})