about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2019-09-23 05:40:11 +0200
committeraszlig <aszlig@nix.build>2019-09-23 05:40:11 +0200
commite1ff1b26045d74eed1f4097f5dcec27fbe1d8042 (patch)
tree5a93dbc2cc294bd59fe29afc48b36f9b63907f13 /tests
parent972808b6806dd6d8c1a0ccc7caf76e1ba36fc36d (diff)
pkgs/psi: Fix Qt5 application wrapping
Qt applications are no longer implicitly wrapped since a while[1] and so
we new have to use wrapQtAppsHook instead, which also makes the wrapping
for Psi obsolete.

To make sure we don't run into startup errors again, I added a small VM
test, which checks whether the application starts up properly.

[1]: https://github.com/NixOS/nixpkgs/commit/f79fd2e826dd95b3b64839d3e0bec8ae1dfab17e

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'tests')
-rw-r--r--tests/aszlig/programs/psi.nix26
-rw-r--r--tests/default.nix1
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/aszlig/programs/psi.nix b/tests/aszlig/programs/psi.nix
new file mode 100644
index 00000000..5ab34da3
--- /dev/null
+++ b/tests/aszlig/programs/psi.nix
@@ -0,0 +1,26 @@
+{ nixpkgsPath, ... }:
+
+{
+  name = "psi-test";
+
+  machine = { pkgs, ... }: {
+    imports = [
+      "${nixpkgsPath}/nixos/tests/common/user-account.nix"
+      "${nixpkgsPath}/nixos/tests/common/x11.nix"
+    ];
+    services.xserver.displayManager.auto.enable = true;
+    services.xserver.displayManager.auto.user = "alice";
+    environment.systemPackages = [ pkgs.vuizvui.aszlig.psi ];
+  };
+
+  enableOCR = true;
+
+  testScript = ''
+    $machine->waitForX;
+    $machine->waitForFile("/home/alice/.Xauthority");
+    $machine->succeed("xauth merge ~alice/.Xauthority");
+    $machine->succeed('su -c "DISPLAY=:0.0 psi" - alice &');
+    $machine->waitForText(qr/Register new account/i);
+    $machine->screenshot('psi');
+  '';
+}
diff --git a/tests/default.nix b/tests/default.nix
index 5e9355e0..edc022ad 100644
--- a/tests/default.nix
+++ b/tests/default.nix
@@ -10,6 +10,7 @@ let
 
 in {
   aszlig.dnyarri.luks2-bcache = callTest ./aszlig/dnyarri/luks2-bcache.nix;
+  aszlig.programs.psi = callTest aszlig/programs/psi.nix;
   games = {
     starbound = callTest ./games/starbound.nix;
   };