diff options
author | Francesco Gazzetta <fgaz@fgaz.me> | 2021-11-18 19:10:48 +0100 |
---|---|---|
committer | Francesco Gazzetta <fgaz@fgaz.me> | 2021-11-19 15:09:53 +0100 |
commit | f3ece9f26cb1ddd4f31359d6151852fa86818648 (patch) | |
tree | 030130779d9b9a97744ec995743406cd8b4082e1 | |
parent | 6ac64dc1c403ce6fce6c00a59a46dedfe0b12160 (diff) |
nixosTests.aseprite: init
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/libresprite.nix | 30 | ||||
-rw-r--r-- | pkgs/applications/editors/libresprite/default.nix | 6 |
3 files changed, 37 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index a74792d3d2eb0..cd13183ed0a32 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -230,6 +230,7 @@ in leaps = handleTest ./leaps.nix {}; libinput = handleTest ./libinput.nix {}; libreddit = handleTest ./libreddit.nix {}; + libresprite = handleTest ./libresprite.nix {}; libreswan = handleTest ./libreswan.nix {}; lidarr = handleTest ./lidarr.nix {}; lightdm = handleTest ./lightdm.nix {}; diff --git a/nixos/tests/libresprite.nix b/nixos/tests/libresprite.nix new file mode 100644 index 0000000000000..1a6210e3671ae --- /dev/null +++ b/nixos/tests/libresprite.nix @@ -0,0 +1,30 @@ +import ./make-test-python.nix ({ pkgs, ... }: { + name = "libresprite"; + meta = with pkgs.lib.maintainers; { + maintainers = [ fgaz ]; + }; + + machine = { config, pkgs, ... }: { + imports = [ + ./common/x11.nix + ]; + + services.xserver.enable = true; + environment.systemPackages = [ + pkgs.imagemagick + pkgs.libresprite + ]; + }; + + enableOCR = true; + + testScript = + '' + machine.wait_for_x() + machine.succeed("convert -font DejaVu-Sans +antialias label:'IT WORKS' image.png") + machine.execute("libresprite image.png >&2 &") + machine.wait_for_window("LibreSprite v${pkgs.libresprite.version}") + machine.wait_for_text("IT WORKS") + machine.screenshot("screen") + ''; +}) diff --git a/pkgs/applications/editors/libresprite/default.nix b/pkgs/applications/editors/libresprite/default.nix index 2221eded720c2..18fbf566876c1 100644 --- a/pkgs/applications/editors/libresprite/default.nix +++ b/pkgs/applications/editors/libresprite/default.nix @@ -22,6 +22,8 @@ , AppKit , Cocoa , Foundation + +, nixosTests }: stdenv.mkDerivation rec { @@ -79,6 +81,10 @@ stdenv.mkDerivation rec { done ''; + passthru.tests = { + libresprite-can-open-png = nixosTests.libresprite; + }; + meta = with lib; { homepage = "https://libresprite.github.io/"; description = "Animated sprite editor & pixel art tool, fork of Aseprite"; |