nixpkgs-suyu/nixos/tests/wine.nix

40 lines
1.2 KiB
Nix
Raw Normal View History

{ system ? builtins.currentSystem, pkgs ? import ../.. {
inherit system;
config = { };
}, }:
let
2021-05-31 08:52:14 +02:00
inherit (pkgs.lib) concatMapStrings listToAttrs;
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;
meta = with pkgs.lib.maintainers; { maintainers = [ chkno ]; };
machine = { pkgs, ... }: {
2021-05-31 08:52:14 +02:00
environment.systemPackages = [ pkgs."${packageSet}"."${variant}" ];
virtualisation.diskSize = "800";
};
testScript = ''
machine.wait_for_unit("multi-user.target")
2021-05-31 08:52:14 +02:00
${concatMapStrings (exe: ''
greeting = machine.succeed(
'wine ${exe}'
)
assert 'Hello, world!' in greeting
'') exes}
'';
};
2021-05-31 08:52:14 +02:00
};
variants = [ "base" "full" "minimal" "staging" "unstable" ];
in listToAttrs (map (makeWineTest "winePackages" [ hello32 ]) variants
++ map (makeWineTest "wineWowPackages" [ hello32 hello64 ]) variants)