about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorLuflosi <luflosi@luflosi.de>2023-04-04 20:18:38 +0200
committerLuflosi <luflosi@luflosi.de>2023-04-13 00:43:44 +0200
commit6032e00504291bfe6b9b6b5e6b03417859722de4 (patch)
tree9bffb1dcc830529d7ff0c3857975d35ce3fc846c /nixos/tests
parent0b572401112cee6cb959692944ed2062e2d71fa8 (diff)
nixos/tests/aaaaxy: init
Add a simple VM test for the game AAAAXY.
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/aaaaxy.nix28
-rw-r--r--nixos/tests/all-tests.nix1
2 files changed, 29 insertions, 0 deletions
diff --git a/nixos/tests/aaaaxy.nix b/nixos/tests/aaaaxy.nix
new file mode 100644
index 0000000000000..a1e1d44773c82
--- /dev/null
+++ b/nixos/tests/aaaaxy.nix
@@ -0,0 +1,28 @@
+{ pkgs, lib, ... }: {
+  name = "aaaaxy";
+  meta.maintainers = with lib.maintainers; [ Luflosi ];
+
+  nodes.machine = {
+    hardware.opengl.enable = true;
+  };
+
+  # This starts the game from a known state, feeds it a prerecorded set of button presses
+  # and then checks if the final game state is identical to the expected state.
+  # This is also what AAAAXY's CI system does and serves as a good sanity check.
+  testScript = ''
+    machine.wait_for_unit("basic.target")
+
+    machine.succeed(
+      # benchmark.dem needs to be in a mutable directory,
+      # so we can't just refer to the file in the Nix store directly
+      "mkdir -p '/tmp/aaaaxy/assets/demos/'",
+      "ln -s '${pkgs.aaaaxy.testing_infra}/assets/demos/benchmark.dem' '/tmp/aaaaxy/assets/demos/'",
+      """
+        '${pkgs.xvfb-run}/bin/xvfb-run' \
+        '${pkgs.aaaaxy.testing_infra}/scripts/regression-test-demo.sh' \
+        'aaaaxy' 'on track for Any%, All Paths and No Teleports' \
+        '${pkgs.aaaaxy}/bin/aaaaxy' '/tmp/aaaaxy/assets/demos/benchmark.dem'
+      """,
+    )
+  '';
+}
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 2ad1ec35022a4..f2d15f329f31d 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -67,6 +67,7 @@ let
 
 in {
   _3proxy = runTest ./3proxy.nix;
+  aaaaxy = runTest ./aaaaxy.nix;
   acme = runTest ./acme.nix;
   adguardhome = runTest ./adguardhome.nix;
   aesmd = runTestOn ["x86_64-linux"] ./aesmd.nix;