From 324e9f686ec39ba5d4a760d957509c52039cec27 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Sun, 21 Nov 2021 18:09:17 +0100 Subject: [PATCH] nixosTests.vengi-tools: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/vengi-tools.nix | 29 +++++++++++++++++++ .../graphics/vengi-tools/default.nix | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 nixos/tests/vengi-tools.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b8219416dc42..ab107dfdcff7 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -486,6 +486,7 @@ in vault-postgresql = handleTest ./vault-postgresql.nix {}; vaultwarden = handleTest ./vaultwarden.nix {}; vector = handleTest ./vector.nix {}; + vengi-tools = handleTest ./vengi-tools.nix {}; victoriametrics = handleTest ./victoriametrics.nix {}; vikunja = handleTest ./vikunja.nix {}; virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {}; diff --git a/nixos/tests/vengi-tools.nix b/nixos/tests/vengi-tools.nix new file mode 100644 index 000000000000..6b90542887d5 --- /dev/null +++ b/nixos/tests/vengi-tools.nix @@ -0,0 +1,29 @@ +import ./make-test-python.nix ({ pkgs, ... }: { + name = "vengi-tools"; + meta = with pkgs.lib.maintainers; { + maintainers = [ fgaz ]; + }; + + machine = { config, pkgs, ... }: { + imports = [ + ./common/x11.nix + ]; + + services.xserver.enable = true; + environment.systemPackages = [ pkgs.vengi-tools ]; + }; + + enableOCR = true; + + testScript = + '' + machine.wait_for_x() + machine.execute("vengi-voxedit >&2 &") + machine.wait_for_window("voxedit") + # OCR on voxedit's window is very expensive, so we avoid wasting a try + # by letting the window load fully first + machine.sleep(15) + machine.wait_for_text("Palette") + machine.screenshot("screen") + ''; +}) diff --git a/pkgs/applications/graphics/vengi-tools/default.nix b/pkgs/applications/graphics/vengi-tools/default.nix index 3ddbea105b53..00b3d80adf04 100644 --- a/pkgs/applications/graphics/vengi-tools/default.nix +++ b/pkgs/applications/graphics/vengi-tools/default.nix @@ -23,6 +23,7 @@ , OpenCL , callPackage +, nixosTests }: # cmake 3.21 inserts invalid `ldd` and `-Wl,--no-as-needed` calls, apparently @@ -97,6 +98,7 @@ in stdenv.mkDerivation rec { passthru.tests = { voxconvert-roundtrip = callPackage ./test-voxconvert-roundtrip.nix {}; + run-voxedit = nixosTests.vengi-tools; }; meta = with lib; {