From e54e9fac95aed076ec5532a4a1b4f030cd4ad853 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Thu, 1 Aug 2024 01:25:25 +0100 Subject: [PATCH] nexusmods-app: cleanup tests & `mainProgram` refs We still need to fix the tests to use `finalAttrs`, but that requires changes to `buildDotnetModule`. --- pkgs/by-name/ne/nexusmods-app/package.nix | 50 ++++++++++++++--------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/ne/nexusmods-app/package.nix b/pkgs/by-name/ne/nexusmods-app/package.nix index 565f4f5d5f72..94274c9dbea1 100644 --- a/pkgs/by-name/ne/nexusmods-app/package.nix +++ b/pkgs/by-name/ne/nexusmods-app/package.nix @@ -58,7 +58,7 @@ buildDotnetModule rec { makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ desktop-file-utils ]}" - "--set APPIMAGE $out/bin/${meta.mainProgram}" # Make associating with nxm links work on Linux + "--set APPIMAGE ${placeholder "out"}/bin/${meta.mainProgram}" # Make associating with nxm links work on Linux ]; runtimeDeps = [ @@ -68,7 +68,7 @@ buildDotnetModule rec { libX11 ]; - executables = [ nexusmods-app.meta.mainProgram ]; + executables = [ meta.mainProgram ]; doCheck = true; @@ -92,24 +92,34 @@ buildDotnetModule rec { ]; passthru = { - tests = { - serve = runCommand "${pname}-test-serve" { } '' - ${nexusmods-app}/bin/${nexusmods-app.meta.mainProgram} - touch $out - ''; - help = runCommand "${pname}-test-help" { } '' - ${nexusmods-app}/bin/${nexusmods-app.meta.mainProgram} --help - touch $out - ''; - associate-nxm = runCommand "${pname}-test-associate-nxm" { } '' - ${nexusmods-app}/bin/${nexusmods-app.meta.mainProgram} associate-nxm - touch $out - ''; - list-tools = runCommand "${pname}-test-list-tools" { } '' - ${nexusmods-app}/bin/${nexusmods-app.meta.mainProgram} list-tools - touch $out - ''; - }; + tests = + let + runTest = + name: script: + runCommand "${pname}-test-${name}" + { + # TODO: use finalAttrs when buildDotnetModule has support + nativeBuildInputs = [ nexusmods-app ]; + } + '' + ${script} + touch $out + ''; + in + { + serve = runTest "serve" '' + NexusMods.App + ''; + help = runTest "help" '' + NexusMods.App --help + ''; + associate-nxm = runTest "associate-nxm" '' + NexusMods.App associate-nxm + ''; + list-tools = runTest "list-tools" '' + NexusMods.App list-tools + ''; + }; updateScript = ./update.bash; };