nixpkgs-suyu/nixos/tests/wine.nix
Scott Worley e83531aa22 wine: gecko 2.47.1 -> 2.47.2
Wine uses gecko 2.47.2 since wine commit
70567d9f2d32fa3f052609051e9913344f24c42a, which
is wine versions 6.0 up through current (6.9)

Add a test verifying that the "Can't find Gecko" error message does
not appear.  A positive test of HTML rendering would be better (eg:
would be robust against changes in the error message string), but this
test is easy to set up & much better than nothing.
2021-05-31 11:58:48 -07:00

42 lines
1.3 KiB
Nix

{ system ? builtins.currentSystem, pkgs ? import ../.. {
inherit system;
config = { };
}, }:
let
inherit (pkgs.lib) concatMapStrings listToAttrs;
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
hello32 = "${pkgs.pkgsCross.mingw32.hello}/bin/hello.exe";
hello64 = "${pkgs.pkgsCross.mingwW64.hello}/bin/hello.exe";
makeWineTest = packageSet: exes: variant: rec {
name = "${packageSet}-${variant}";
value = makeTest {
inherit name;
meta = with pkgs.lib.maintainers; { maintainers = [ chkno ]; };
machine = { pkgs, ... }: {
environment.systemPackages = [ pkgs."${packageSet}"."${variant}" ];
virtualisation.diskSize = "800";
};
testScript = ''
machine.wait_for_unit("multi-user.target")
${concatMapStrings (exe: ''
greeting = machine.succeed(
"bash -c 'wine ${exe} 2> >(tee wine-stderr >&2)'"
)
assert 'Hello, world!' in greeting
machine.fail(
"fgrep 'Could not find Wine Gecko. HTML rendering will be disabled.' wine-stderr"
)
'') exes}
'';
};
};
variants = [ "base" "full" "minimal" "staging" "unstable" ];
in listToAttrs (map (makeWineTest "winePackages" [ hello32 ]) variants
++ map (makeWineTest "wineWowPackages" [ hello32 hello64 ]) variants)