mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 07:46:09 +01:00
buildDotnetModule: set LD_LIBRARY_PATH from runtimeDeps in dotnetCheckHook
Tests should execute in a similar environment to the final app
This commit is contained in:
parent
070314b62d
commit
3d79e4871b
2 changed files with 6 additions and 3 deletions
|
@ -11,6 +11,9 @@
|
|||
, buildType
|
||||
}:
|
||||
|
||||
let
|
||||
libraryPath = lib.makeLibraryPath runtimeDeps;
|
||||
in
|
||||
{
|
||||
dotnetConfigureHook = callPackage ({ }:
|
||||
makeSetupHook {
|
||||
|
@ -35,7 +38,7 @@
|
|||
name = "dotnet-check-hook";
|
||||
deps = [ dotnet-test-sdk ];
|
||||
substitutions = {
|
||||
inherit buildType;
|
||||
inherit buildType libraryPath;
|
||||
disabledTests = lib.optionalString (disabledTests != [])
|
||||
(lib.concatStringsSep "&FullyQualifiedName!=" disabledTests);
|
||||
};
|
||||
|
@ -56,7 +59,7 @@
|
|||
deps = [ dotnet-runtime makeWrapper ];
|
||||
substitutions = {
|
||||
dotnetRuntime = dotnet-runtime;
|
||||
runtimeDeps = lib.makeLibraryPath runtimeDeps;
|
||||
runtimeDeps = libraryPath;
|
||||
};
|
||||
} ./dotnet-fixup-hook.sh) { };
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ dotnetCheckHook() {
|
|||
fi
|
||||
|
||||
for project in ${testProjectFile[@]}; do
|
||||
env \
|
||||
env "LD_LIBRARY_PATH=@libraryPath@" \
|
||||
dotnet test "$project" \
|
||||
-maxcpucount:$maxCpuFlag \
|
||||
-p:ContinuousIntegrationBuild=true \
|
||||
|
|
Loading…
Reference in a new issue