2021-11-04 23:20:06 +01:00
|
|
|
{ system ? builtins.currentSystem
|
|
|
|
, pkgs ? import ../.. { inherit system; config = { }; }
|
|
|
|
}:
|
2021-05-31 07:00:17 +02:00
|
|
|
|
|
|
|
let
|
2021-05-31 08:52:14 +02:00
|
|
|
inherit (pkgs.lib) concatMapStrings listToAttrs;
|
2021-05-31 07:00:17 +02:00
|
|
|
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
|
|
|
|
|
2021-05-31 08:52:14 +02:00
|
|
|
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;
|
2021-05-31 07:00:17 +02:00
|
|
|
meta = with pkgs.lib.maintainers; { maintainers = [ chkno ]; };
|
|
|
|
|
|
|
|
machine = { pkgs, ... }: {
|
2021-05-31 08:52:14 +02:00
|
|
|
environment.systemPackages = [ pkgs."${packageSet}"."${variant}" ];
|
2022-01-26 17:14:23 +01:00
|
|
|
virtualisation.diskSize = 800;
|
2021-05-31 07:00:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.wait_for_unit("multi-user.target")
|
2021-05-31 08:52:14 +02:00
|
|
|
${concatMapStrings (exe: ''
|
|
|
|
greeting = machine.succeed(
|
2021-05-31 17:17:08 +02:00
|
|
|
"bash -c 'wine ${exe} 2> >(tee wine-stderr >&2)'"
|
2021-05-31 08:52:14 +02:00
|
|
|
)
|
|
|
|
assert 'Hello, world!' in greeting
|
2021-05-31 17:17:08 +02:00
|
|
|
machine.fail(
|
|
|
|
"fgrep 'Could not find Wine Gecko. HTML rendering will be disabled.' wine-stderr"
|
|
|
|
)
|
2021-05-31 08:52:14 +02:00
|
|
|
'') exes}
|
2021-05-31 07:00:17 +02:00
|
|
|
'';
|
|
|
|
};
|
2021-05-31 08:52:14 +02:00
|
|
|
};
|
|
|
|
|
2022-01-03 05:10:16 +01:00
|
|
|
variants = [ "base" "full" "minimal" "staging" "unstable" "wayland" ];
|
2021-05-31 08:52:14 +02:00
|
|
|
|
|
|
|
in listToAttrs (map (makeWineTest "winePackages" [ hello32 ]) variants
|
|
|
|
++ map (makeWineTest "wineWowPackages" [ hello32 hello64 ]) variants)
|