2021-11-04 22:20:06 +00:00
|
|
|
{ system ? builtins.currentSystem
|
|
|
|
, pkgs ? import ../.. { inherit system; config = { }; }
|
|
|
|
}:
|
2021-05-31 05:00:17 +00:00
|
|
|
|
|
|
|
let
|
2022-01-22 20:21:13 +00:00
|
|
|
inherit (pkgs.lib) concatMapStrings listToAttrs optionals optionalString;
|
2021-05-31 05:00:17 +00:00
|
|
|
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
|
|
|
|
|
2021-05-31 06:52:14 +00: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 05:00:17 +00:00
|
|
|
meta = with pkgs.lib.maintainers; { maintainers = [ chkno ]; };
|
|
|
|
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine = { pkgs, ... }: {
|
2021-05-31 06:52:14 +00:00
|
|
|
environment.systemPackages = [ pkgs."${packageSet}"."${variant}" ];
|
2022-01-26 16:14:23 +00:00
|
|
|
virtualisation.diskSize = 800;
|
2021-05-31 05:00:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.wait_for_unit("multi-user.target")
|
2021-05-31 06:52:14 +00:00
|
|
|
${concatMapStrings (exe: ''
|
|
|
|
greeting = machine.succeed(
|
2021-05-31 15:17:08 +00:00
|
|
|
"bash -c 'wine ${exe} 2> >(tee wine-stderr >&2)'"
|
2021-05-31 06:52:14 +00:00
|
|
|
)
|
|
|
|
assert 'Hello, world!' in greeting
|
2022-01-22 20:21:13 +00:00
|
|
|
''
|
|
|
|
# only the full version contains Gecko, but the error is not printed reliably in other variants
|
|
|
|
+ optionalString (variant == "full") ''
|
2021-05-31 15:17:08 +00:00
|
|
|
machine.fail(
|
|
|
|
"fgrep 'Could not find Wine Gecko. HTML rendering will be disabled.' wine-stderr"
|
|
|
|
)
|
2021-05-31 06:52:14 +00:00
|
|
|
'') exes}
|
2021-05-31 05:00:17 +00:00
|
|
|
'';
|
|
|
|
};
|
2021-05-31 06:52:14 +00:00
|
|
|
};
|
|
|
|
|
2022-01-03 04:10:16 +00:00
|
|
|
variants = [ "base" "full" "minimal" "staging" "unstable" "wayland" ];
|
2021-05-31 06:52:14 +00:00
|
|
|
|
2022-01-22 20:21:13 +00:00
|
|
|
in
|
|
|
|
listToAttrs (
|
|
|
|
map (makeWineTest "winePackages" [ hello32 ]) variants
|
2024-09-24 15:50:49 +00:00
|
|
|
++ optionals pkgs.stdenv.hostPlatform.is64bit
|
2022-10-07 15:50:17 +00:00
|
|
|
(map (makeWineTest "wineWowPackages" [ hello32 hello64 ])
|
|
|
|
# This wayland combination times out after spending many hours.
|
|
|
|
# https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.wine.wineWowPackages-wayland.x86_64-linux
|
|
|
|
(pkgs.lib.remove "wayland" variants))
|
2022-01-22 20:21:13 +00:00
|
|
|
)
|