1{ system ? builtins.currentSystem
2, pkgs ? import ../.. { inherit system; config = { }; }
3}:
4
5let
6 inherit (pkgs.lib) concatMapStrings listToAttrs;
7 inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
8
9 hello32 = "${pkgs.pkgsCross.mingw32.hello}/bin/hello.exe";
10 hello64 = "${pkgs.pkgsCross.mingwW64.hello}/bin/hello.exe";
11
12 makeWineTest = packageSet: exes: variant: rec {
13 name = "${packageSet}-${variant}";
14 value = makeTest {
15 inherit name;
16 meta = with pkgs.lib.maintainers; { maintainers = [ chkno ]; };
17
18 machine = { pkgs, ... }: {
19 environment.systemPackages = [ pkgs."${packageSet}"."${variant}" ];
20 virtualisation.diskSize = "800";
21 };
22
23 testScript = ''
24 machine.wait_for_unit("multi-user.target")
25 ${concatMapStrings (exe: ''
26 greeting = machine.succeed(
27 "bash -c 'wine ${exe} 2> >(tee wine-stderr >&2)'"
28 )
29 assert 'Hello, world!' in greeting
30 machine.fail(
31 "fgrep 'Could not find Wine Gecko. HTML rendering will be disabled.' wine-stderr"
32 )
33 '') exes}
34 '';
35 };
36 };
37
38 variants = [ "base" "full" "minimal" "staging" "unstable" ];
39
40in listToAttrs (map (makeWineTest "winePackages" [ hello32 ]) variants
41 ++ map (makeWineTest "wineWowPackages" [ hello32 hello64 ]) variants)