diff options
Diffstat (limited to 'pkgs/development/compilers/dotnet/common.nix')
-rw-r--r-- | pkgs/development/compilers/dotnet/common.nix | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/development/compilers/dotnet/common.nix b/pkgs/development/compilers/dotnet/common.nix index a757dd36d17b2..49f3e3be4d779 100644 --- a/pkgs/development/compilers/dotnet/common.nix +++ b/pkgs/development/compilers/dotnet/common.nix @@ -63,7 +63,7 @@ '' + build); in if run == null - then build + then built else runCommand "${built.name}-run" { src = built; nativeBuildInputs = runInputs; } ( lib.optionalString (runtime != null) '' @@ -71,8 +71,10 @@ export DOTNET_ROOT=${runtime} '' + run); + # Setting LANG to something other than 'C' forces the runtime to search + # for ICU, which will be required in most user environments. checkConsoleOutput = command: '' - output="$(${command})" + output="$(LANG=C.UTF-8 ${command})" # yes, older SDKs omit the comma [[ "$output" =~ Hello,?\ World! ]] && touch "$out" ''; @@ -98,6 +100,15 @@ run = checkConsoleOutput "$src/test"; }; + self-contained = mkDotnetTest { + name = "self-contained"; + template = "console"; + usePackageSource = true; + build = "dotnet publish --use-current-runtime --sc -o $out"; + runtime = null; + run = checkConsoleOutput "$src/test"; + }; + single-file = mkDotnetTest { name = "single-file"; template = "console"; |