1import ./make-test-python.nix ({ pkgs, ... }: {
2 name = "shattered-pixel-dungeon";
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ fgaz ];
5 };
6
7 nodes.machine = { config, pkgs, ... }: {
8 imports = [
9 ./common/x11.nix
10 ];
11
12 services.xserver.enable = true;
13 sound.enable = true;
14 environment.systemPackages = [ pkgs.shattered-pixel-dungeon ];
15 };
16
17 enableOCR = true;
18
19 testScript =
20 ''
21 machine.wait_for_x()
22 machine.execute("shattered-pixel-dungeon >&2 &")
23 machine.wait_for_window(r"Shattered Pixel Dungeon")
24 machine.sleep(5)
25 if "Enter" not in machine.get_screen_text():
26 raise Exception("Program did not start successfully")
27 machine.screenshot("screen")
28 '';
29})
30