summary refs log tree commit diff
path: root/nixos/tests/shattered-pixel-dungeon.nix
blob: d4e5de22ab9d0dac7869445765a8a5d5a53dc0c8 (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
import ./make-test-python.nix ({ pkgs, ... }: {
  name = "shattered-pixel-dungeon";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ fgaz ];
  };

  machine = { config, pkgs, ... }: {
    imports = [
      ./common/x11.nix
    ];

    services.xserver.enable = true;
    sound.enable = true;
    environment.systemPackages = [ pkgs.shattered-pixel-dungeon ];
  };

  enableOCR = true;

  testScript =
    ''
      machine.wait_for_x()
      machine.execute("shattered-pixel-dungeon >&2 &")
      machine.wait_for_window(r"Shattered Pixel Dungeon")
      machine.sleep(5)
      if "Enter" not in machine.get_screen_text():
          raise Exception("Program did not start successfully")
      machine.screenshot("screen")
    '';
})