nixosTests.warzone2100: init

This commit is contained in:
Francesco Gazzetta 2022-11-24 20:46:05 +01:00
parent 533eaa2781
commit cc0182e2d1
3 changed files with 29 additions and 0 deletions

View file

@ -689,6 +689,7 @@ in {
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
vscodium = discoverTests (import ./vscodium.nix);
vsftpd = handleTest ./vsftpd.nix {};
warzone2100 = handleTest ./warzone2100.nix {};
wasabibackend = handleTest ./wasabibackend.nix {};
wiki-js = handleTest ./wiki-js.nix {};
wine = handleTest ./wine.nix {};

View file

@ -0,0 +1,26 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "warzone2100";
meta = with pkgs.lib.maintainers; {
maintainers = [ fgaz ];
};
nodes.machine = { config, pkgs, ... }: {
imports = [
./common/x11.nix
];
services.xserver.enable = true;
environment.systemPackages = [ pkgs.warzone2100 ];
};
enableOCR = true;
testScript =
''
machine.wait_for_x()
machine.execute("warzone2100 >&2 &")
machine.wait_for_window("Warzone 2100")
machine.wait_for_text(r"(Single Player|Multi Player|Tutorial|Options|Quit Game)")
machine.screenshot("screen")
'';
})

View file

@ -29,6 +29,7 @@
, testers
, warzone2100
, nixosTests
, withVideos ? false
}:
@ -111,6 +112,7 @@ stdenv.mkDerivation rec {
# The command always exits with code 1
command = "(warzone2100 --version || [ $? -eq 1 ])";
};
nixosTest = nixosTests.warzone2100;
};
meta = with lib; {