From b9bc59d832bea0bb30c9aff06c18f8e877a4539d Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Sun, 20 Mar 2022 22:39:04 +0100 Subject: [PATCH] sfxr-qt: add nixos test --- nixos/tests/all-tests.nix | 1 + nixos/tests/sfxr-qt.nix | 32 +++++++++++++++++++++ pkgs/applications/audio/sfxr-qt/default.nix | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 nixos/tests/sfxr-qt.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b2b35119ce35..168f766ba431 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -468,6 +468,7 @@ in seafile = handleTest ./seafile.nix {}; searx = handleTest ./searx.nix {}; service-runner = handleTest ./service-runner.nix {}; + sfxr-qt = handleTest ./sfxr-qt.nix {}; shadow = handleTest ./shadow.nix {}; shadowsocks = handleTest ./shadowsocks {}; shattered-pixel-dungeon = handleTest ./shattered-pixel-dungeon.nix {}; diff --git a/nixos/tests/sfxr-qt.nix b/nixos/tests/sfxr-qt.nix new file mode 100644 index 000000000000..976b9b11fc66 --- /dev/null +++ b/nixos/tests/sfxr-qt.nix @@ -0,0 +1,32 @@ +import ./make-test-python.nix ({ pkgs, ... }: { + name = "sfxr-qt"; + meta = with pkgs.lib.maintainers; { + maintainers = [ fgaz ]; + }; + + machine = { config, pkgs, ... }: { + imports = [ + ./common/x11.nix + ]; + + services.xserver.enable = true; + sound.enable = true; + environment.systemPackages = [ pkgs.sfxr-qt ]; + }; + + enableOCR = true; + + testScript = + '' + machine.wait_for_x() + # Add a dummy sound card, or the program won't start + machine.execute("modprobe snd-dummy") + + machine.execute("sfxr-qt >&2 &") + + machine.wait_for_window(r"sfxr") + machine.sleep(10) + machine.wait_for_text("requency") + machine.screenshot("screen") + ''; +}) diff --git a/pkgs/applications/audio/sfxr-qt/default.nix b/pkgs/applications/audio/sfxr-qt/default.nix index f974f9d4d4d8..0ffd754c0476 100644 --- a/pkgs/applications/audio/sfxr-qt/default.nix +++ b/pkgs/applications/audio/sfxr-qt/default.nix @@ -9,6 +9,7 @@ , SDL , python3 , callPackage +, nixosTests }: mkDerivation rec { @@ -44,6 +45,7 @@ mkDerivation rec { passthru.tests = { export-square-wave = callPackage ./test-export-square-wave {}; + sfxr-qt-starts = nixosTests.sfxr-qt; }; meta = with lib; {