diff options
| author | Francesco Gazzetta <fgaz@fgaz.me> | 2022-11-24 20:46:05 +0100 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2022-11-26 09:00:21 +0000 |
| commit | b1a9299004add4070486d049aae21dc7b3541a05 (patch) | |
| tree | 5f83572d23d6782e9d161ffc8ecccdff43521fcc | |
| parent | warzone2100: 4.3.1 -> 4.3.2 (diff) | |
| download | nixpkgs-b1a9299004add4070486d049aae21dc7b3541a05.tar.gz | |
nixosTests.warzone2100: initorigin/backport-202728-to-release-22.11
(cherry picked from commit cc0182e2d1796351802f19703be1926fc9e1656f)
| -rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
| -rw-r--r-- | nixos/tests/warzone2100.nix | 26 | ||||
| -rw-r--r-- | pkgs/games/warzone2100/default.nix | 2 |
3 files changed, 29 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 1fa5b0b1c13d..bb3d50d9a78c 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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 {}; diff --git a/nixos/tests/warzone2100.nix b/nixos/tests/warzone2100.nix new file mode 100644 index 000000000000..568e04a46999 --- /dev/null +++ b/nixos/tests/warzone2100.nix @@ -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") + ''; +}) diff --git a/pkgs/games/warzone2100/default.nix b/pkgs/games/warzone2100/default.nix index f819c9b2bc16..6307decb6a4d 100644 --- a/pkgs/games/warzone2100/default.nix +++ b/pkgs/games/warzone2100/default.nix @@ -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; { |
