Merge pull request #11153 from nix-windows/wine-ci

Run unit tests with wine
This commit is contained in:
John Ericson 2024-07-22 13:35:32 -04:00 committed by GitHub
commit 00fd180a79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 49 additions and 33 deletions

View file

@ -69,11 +69,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1717432640, "lastModified": 1721560568,
"narHash": "sha256-+f9c4/ZX5MWDOuB1rKoWj+lBNm0z0rs4CK47HBLxy1o=", "narHash": "sha256-L61BXz7n/yNzOeZ3FqlnUmxj4145JOVeq9fvQTQzbNM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "88269ab3044128b7c2f4c7d68448b2fb50456870", "rev": "be3ca229c85e978880babdeda9748b14e6aa008f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,4 +1,5 @@
{ lib { lib
, buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools , releaseTools
@ -41,8 +42,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
@ -83,17 +82,21 @@ mkMesonDerivation (finalAttrs: {
passthru = { passthru = {
tests = { tests = {
run = runCommand "${finalAttrs.pname}-run" { run = runCommand "${finalAttrs.pname}-run" {
} '' meta.broken = !stdenv.hostPlatform.emulatorAvailable buildPackages;
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH" } (lib.optionalString stdenv.hostPlatform.isWindows ''
export HOME="$PWD/home-dir"
mkdir -p "$HOME"
'' + ''
export _NIX_TEST_UNIT_DATA=${resolvePath ./data} export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
nix-expr-tests ${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
touch $out touch $out
''; '');
}; };
}; };
meta = { meta = {
platforms = lib.platforms.unix ++ lib.platforms.windows; platforms = lib.platforms.unix ++ lib.platforms.windows;
mainProgram = finalAttrs.pname + stdenv.hostPlatform.extensions.executable;
}; };
}) })

View file

@ -1,4 +1,5 @@
{ lib { lib
, buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools , releaseTools
@ -40,8 +41,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
@ -81,17 +80,21 @@ mkMesonDerivation (finalAttrs: {
passthru = { passthru = {
tests = { tests = {
run = runCommand "${finalAttrs.pname}-run" { run = runCommand "${finalAttrs.pname}-run" {
} '' meta.broken = !stdenv.hostPlatform.emulatorAvailable buildPackages;
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH" } (lib.optionalString stdenv.hostPlatform.isWindows ''
export HOME="$PWD/home-dir"
mkdir -p "$HOME"
'' + ''
export _NIX_TEST_UNIT_DATA=${resolvePath ./data} export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
nix-fetchers-tests ${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
touch $out touch $out
''; '');
}; };
}; };
meta = { meta = {
platforms = lib.platforms.unix ++ lib.platforms.windows; platforms = lib.platforms.unix ++ lib.platforms.windows;
mainProgram = finalAttrs.pname + stdenv.hostPlatform.extensions.executable;
}; };
}) })

View file

@ -1,4 +1,5 @@
{ lib { lib
, buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools , releaseTools
@ -40,8 +41,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
@ -81,17 +80,21 @@ mkMesonDerivation (finalAttrs: {
passthru = { passthru = {
tests = { tests = {
run = runCommand "${finalAttrs.pname}-run" { run = runCommand "${finalAttrs.pname}-run" {
} '' meta.broken = !stdenv.hostPlatform.emulatorAvailable buildPackages;
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH" } (lib.optionalString stdenv.hostPlatform.isWindows ''
export HOME="$PWD/home-dir"
mkdir -p "$HOME"
'' + ''
export _NIX_TEST_UNIT_DATA=${resolvePath ./data} export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
nix-flake-tests ${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
touch $out touch $out
''; '');
}; };
}; };
meta = { meta = {
platforms = lib.platforms.unix ++ lib.platforms.windows; platforms = lib.platforms.unix ++ lib.platforms.windows;
mainProgram = finalAttrs.pname + stdenv.hostPlatform.extensions.executable;
}; };
}) })

View file

@ -1,4 +1,5 @@
{ lib { lib
, buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools , releaseTools
@ -42,8 +43,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
@ -94,17 +93,22 @@ mkMesonDerivation (finalAttrs: {
../../functional/derivation ../../functional/derivation
]; ];
}; };
in runCommand "${finalAttrs.pname}-run" {} '' in runCommand "${finalAttrs.pname}-run" {
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH" meta.broken = !stdenv.hostPlatform.emulatorAvailable buildPackages;
} (lib.optionalString stdenv.hostPlatform.isWindows ''
export HOME="$PWD/home-dir"
mkdir -p "$HOME"
'' + ''
export _NIX_TEST_UNIT_DATA=${data + "/unit/libstore/data"} export _NIX_TEST_UNIT_DATA=${data + "/unit/libstore/data"}
nix-store-tests ${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
touch $out touch $out
''; '');
}; };
}; };
meta = { meta = {
platforms = lib.platforms.unix ++ lib.platforms.windows; platforms = lib.platforms.unix ++ lib.platforms.windows;
mainProgram = finalAttrs.pname + stdenv.hostPlatform.extensions.executable;
}; };
}) })

View file

@ -1,4 +1,5 @@
{ lib { lib
, buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools , releaseTools
@ -40,8 +41,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
@ -82,17 +81,21 @@ mkMesonDerivation (finalAttrs: {
passthru = { passthru = {
tests = { tests = {
run = runCommand "${finalAttrs.pname}-run" { run = runCommand "${finalAttrs.pname}-run" {
} '' meta.broken = !stdenv.hostPlatform.emulatorAvailable buildPackages;
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH" } (lib.optionalString stdenv.hostPlatform.isWindows ''
export HOME="$PWD/home-dir"
mkdir -p "$HOME"
'' + ''
export _NIX_TEST_UNIT_DATA=${./data} export _NIX_TEST_UNIT_DATA=${./data}
nix-util-tests ${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
touch $out touch $out
''; '');
}; };
}; };
meta = { meta = {
platforms = lib.platforms.unix ++ lib.platforms.windows; platforms = lib.platforms.unix ++ lib.platforms.windows;
mainProgram = finalAttrs.pname + stdenv.hostPlatform.extensions.executable;
}; };
}) })