about summary refs log tree commit diff
path: root/nixos/tests/wine.nix
diff options
context:
space:
mode:
authorScott Worley <scottworley@scottworley.com>2021-05-30 23:52:14 -0700
committerScott Worley <scottworley@scottworley.com>2021-05-31 11:58:48 -0700
commita9eecaff54b506ae37207c2dbb46da4dfc68bfd1 (patch)
treef22d024ff17a04bcad3bc357bd44435f76c3dbd2 /nixos/tests/wine.nix
parent2690ab613b6226bdbb97503cc5754af213114ca5 (diff)
nixos/tests/wine: Test 32 and 64 bit
Diffstat (limited to 'nixos/tests/wine.nix')
-rw-r--r--nixos/tests/wine.nix32
1 files changed, 22 insertions, 10 deletions
diff --git a/nixos/tests/wine.nix b/nixos/tests/wine.nix
index 49ee19fe6affb..566b9baa67bfa 100644
--- a/nixos/tests/wine.nix
+++ b/nixos/tests/wine.nix
@@ -4,24 +4,36 @@
 }, }:
 
 let
+  inherit (pkgs.lib) concatMapStrings listToAttrs;
   inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
 
-  makeWineTest = variant:
-    makeTest {
-      name = "wine-${variant}";
+  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.winePackages."${variant}" ];
+        environment.systemPackages = [ pkgs."${packageSet}"."${variant}" ];
+        virtualisation.diskSize = "800";
       };
 
       testScript = ''
         machine.wait_for_unit("multi-user.target")
-        greeting = machine.succeed(
-            'wine ${pkgs.pkgsCross.mingw32.hello}/bin/hello.exe'
-        )
-        assert 'Hello, world!' in greeting
+        ${concatMapStrings (exe: ''
+          greeting = machine.succeed(
+              'wine ${exe}'
+          )
+          assert 'Hello, world!' in greeting
+        '') exes}
       '';
     };
-in pkgs.lib.genAttrs [ "base" "full" "minimal" "staging" "unstable" ]
-makeWineTest
+  };
+
+  variants = [ "base" "full" "minimal" "staging" "unstable" ];
+
+in listToAttrs (map (makeWineTest "winePackages" [ hello32 ]) variants
+  ++ map (makeWineTest "wineWowPackages" [ hello32 hello64 ]) variants)