Skip to content

Commit

Permalink
Merge pull request #94187 from fgaz/ft2-clone/1.27
Browse files Browse the repository at this point in the history
ft2-clone: add a test
  • Loading branch information
timokau authored Oct 12, 2020
2 parents 38c6398 + 75414df commit 787ec15
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,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 {};
Expand Down
35 changes: 35 additions & 0 deletions nixos/tests/ft2-clone.nix
Original file line number Diff line number Diff line change
@@ -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")
'';
})

10 changes: 9 additions & 1 deletion pkgs/applications/audio/ft2-clone/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ stdenv
, fetchFromGitHub
, cmake
, nixosTests
, alsaLib
, SDL2
, libiconv
}:

stdenv.mkDerivation rec {
Expand All @@ -17,7 +19,13 @@ stdenv.mkDerivation rec {
};

nativeBuildInputs = [ cmake ];
buildInputs = [ SDL2 ] ++ stdenv.lib.optional stdenv.isLinux alsaLib;
buildInputs = [ SDL2 ]
++ stdenv.lib.optional stdenv.isLinux alsaLib
++ stdenv.lib.optional stdenv.isDarwin libiconv;

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";
Expand Down

0 comments on commit 787ec15

Please sign in to comment.