ft2-clone: add nixos test

This commit is contained in:
Francesco Gazzetta 2020-07-29 19:40:38 +02:00
parent 78215a8395
commit e158d19618
3 changed files with 41 additions and 0 deletions

View File

@ -108,6 +108,7 @@ in
fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
freeswitch = handleTest ./freeswitch.nix {};
fsck = handleTest ./fsck.nix {};
ft2-clone = handleTest ./ft2-clone.nix {};
gerrit = handleTest ./gerrit.nix {};
gotify-server = handleTest ./gotify-server.nix {};
grocy = handleTest ./grocy.nix {};

35
nixos/tests/ft2-clone.nix Normal file
View File

@ -0,0 +1,35 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "ft2-clone";
meta = with pkgs.lib.maintainers; {
maintainers = [ fgaz ];
};
machine = { config, pkgs, ... }: {
imports = [
./common/x11.nix
];
services.xserver.enable = true;
sound.enable = true;
environment.systemPackages = [ pkgs.ft2-clone ];
};
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("ft2-clone &")
machine.wait_for_window(r"Fasttracker")
machine.sleep(5)
# One of the few words that actually get recognized
if "Songlen" not in machine.get_screen_text():
raise Exception("Program did not start successfully")
machine.screenshot("screen")
'';
})

View File

@ -1,6 +1,7 @@
{ stdenv
, fetchFromGitHub
, cmake
, nixosTests
, alsaLib
, SDL2
}:
@ -19,6 +20,10 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [ SDL2 ] ++ stdenv.lib.optional stdenv.isLinux alsaLib;
passthru.tests = {
ft2-clone-starts = nixosTests.ft2-clone;
};
meta = with stdenv.lib; {
description = "A highly accurate clone of the classic Fasttracker II software for MS-DOS";
homepage = "https://16-bits.org/ft2.php";