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