From 2690ab613b6226bdbb97503cc5754af213114ca5 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sun, 30 May 2021 22:00:17 -0700 Subject: [PATCH] nixos/tests/wine: Test all five wine variants --- nixos/tests/wine.nix | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/nixos/tests/wine.nix b/nixos/tests/wine.nix index 29b8c482808..49ee19fe6af 100644 --- a/nixos/tests/wine.nix +++ b/nixos/tests/wine.nix @@ -1,14 +1,27 @@ -import ./make-test-python.nix ({ pkgs, ... }: { - name = "wine"; - meta = with pkgs.lib.maintainers; { maintainers = [ chkno ]; }; +{ system ? builtins.currentSystem, pkgs ? import ../.. { + inherit system; + config = { }; +}, }: - machine = { pkgs, ... }: { environment.systemPackages = [ pkgs.wine ]; }; +let + inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest; - testScript = '' - machine.wait_for_unit("multi-user.target") - greeting = machine.succeed( - 'wine ${pkgs.pkgsCross.mingw32.hello}/bin/hello.exe' - ) - assert 'Hello, world!' in greeting - ''; -}) + makeWineTest = variant: + makeTest { + name = "wine-${variant}"; + meta = with pkgs.lib.maintainers; { maintainers = [ chkno ]; }; + + machine = { pkgs, ... }: { + environment.systemPackages = [ pkgs.winePackages."${variant}" ]; + }; + + testScript = '' + machine.wait_for_unit("multi-user.target") + greeting = machine.succeed( + 'wine ${pkgs.pkgsCross.mingw32.hello}/bin/hello.exe' + ) + assert 'Hello, world!' in greeting + ''; + }; +in pkgs.lib.genAttrs [ "base" "full" "minimal" "staging" "unstable" ] +makeWineTest