···11+import ./make-test-python.nix ({ pkgs, ... }: {
22+ name = "mindustry";
33+ meta = with pkgs.lib.maintainers; {
44+ maintainers = [ fgaz ];
55+ };
66+77+ nodes.machine = { config, pkgs, ... }: {
88+ imports = [
99+ ./common/x11.nix
1010+ ];
1111+1212+ services.xserver.enable = true;
1313+ environment.systemPackages = [ pkgs.mindustry ];
1414+ };
1515+1616+ enableOCR = true;
1717+1818+ testScript =
1919+ ''
2020+ machine.wait_for_x()
2121+ machine.execute("mindustry >&2 &")
2222+ machine.wait_for_window("Mindustry")
2323+ # Loading can take a while. Avoid wasting cycles on OCR during that time
2424+ machine.sleep(60)
2525+ machine.wait_for_text(r"(Play|Database|Editor|Mods|Settings|Quit)")
2626+ machine.screenshot("screen")
2727+ '';
2828+})
+6
pkgs/games/mindustry/default.nix
···2020, libpulseaudio ? null
2121, libjack2 ? null
22222323+, nixosTests
2424+23252426# Make the build version easily overridable.
2527# Server and client build versions must match, and an empty build version means
···214216 '' + ''
215217 runHook postInstall
216218 '';
219219+220220+ passthru.tests = {
221221+ nixosTest = nixosTests.mindustry;
222222+ };
217223218224 meta = with lib; {
219225 homepage = "https://mindustrygame.github.io/";