nixosTests.mindustry: init

This commit is contained in:
Francesco Gazzetta 2023-01-15 00:28:32 +01:00
parent 7f6757e4f2
commit cbe58afca0
3 changed files with 35 additions and 0 deletions

View File

@ -389,6 +389,7 @@ in {
memcached = handleTest ./memcached.nix {};
merecat = handleTest ./merecat.nix {};
metabase = handleTest ./metabase.nix {};
mindustry = handleTest ./mindustry.nix {};
minecraft = handleTest ./minecraft.nix {};
minecraft-server = handleTest ./minecraft-server.nix {};
minidlna = handleTest ./minidlna.nix {};

28
nixos/tests/mindustry.nix Normal file
View File

@ -0,0 +1,28 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "mindustry";
meta = with pkgs.lib.maintainers; {
maintainers = [ fgaz ];
};
nodes.machine = { config, pkgs, ... }: {
imports = [
./common/x11.nix
];
services.xserver.enable = true;
environment.systemPackages = [ pkgs.mindustry ];
};
enableOCR = true;
testScript =
''
machine.wait_for_x()
machine.execute("mindustry >&2 &")
machine.wait_for_window("Mindustry")
# Loading can take a while. Avoid wasting cycles on OCR during that time
machine.sleep(60)
machine.wait_for_text(r"(Play|Database|Editor|Mods|Settings|Quit)")
machine.screenshot("screen")
'';
})

View File

@ -20,6 +20,8 @@
, libpulseaudio ? null
, libjack2 ? null
, nixosTests
# Make the build version easily overridable.
# Server and client build versions must match, and an empty build version means
@ -215,6 +217,10 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
passthru.tests = {
nixosTest = nixosTests.mindustry;
};
meta = with lib; {
homepage = "https://mindustrygame.github.io/";
downloadPage = "https://github.com/Anuken/Mindustry/releases";