|
4 | 4 | #nullable disable
|
5 | 5 |
|
6 | 6 | using System.Runtime.CompilerServices;
|
| 7 | +using System.Runtime.InteropServices; |
7 | 8 | using Microsoft.Extensions.DependencyModel;
|
8 | 9 | using Microsoft.NET.Build.Tasks;
|
9 | 10 | using Newtonsoft.Json.Linq;
|
@@ -167,7 +168,8 @@ private void It_targets_the_right_framework(
|
167 | 168 |
|
168 | 169 | var additionalProbingPaths = ((JArray)devruntimeConfig["runtimeOptions"]["additionalProbingPaths"]).Values<string>();
|
169 | 170 | // can't use Path.Combine on segments with an illegal `|` character
|
170 |
| - var expectedPath = $"{Path.Combine(FileConstants.UserProfileFolder, ".dotnet", "store")}{Path.DirectorySeparatorChar}|arch|{Path.DirectorySeparatorChar}|tfm|"; |
| 171 | + var homePath = Environment.GetEnvironmentVariable(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "USERPROFILE" : "HOME"); |
| 172 | + var expectedPath = $"{Path.Combine(homePath, ".dotnet", "store")}{Path.DirectorySeparatorChar}|arch|{Path.DirectorySeparatorChar}|tfm|"; |
171 | 173 | additionalProbingPaths.Should().Contain(expectedPath);
|
172 | 174 | }
|
173 | 175 |
|
@@ -269,7 +271,7 @@ public void It_runs_the_app_from_the_output_folder(string targetFramework)
|
269 | 271 | [InlineData("net7.0")]
|
270 | 272 | [InlineData(ToolsetInfo.CurrentTargetFramework)]
|
271 | 273 | public void It_runs_a_rid_specific_app_from_the_output_folder(string targetFramework)
|
272 |
| - { |
| 274 | + { |
273 | 275 | RunAppFromOutputFolder("RunFromOutputFolderWithRID_" + targetFramework, true, false, targetFramework);
|
274 | 276 | }
|
275 | 277 |
|
@@ -1001,7 +1003,7 @@ public void It_warns_on_nonportable_rids(string targetFramework, string[] rids,
|
1001 | 1003 | IsExe = true
|
1002 | 1004 | };
|
1003 | 1005 |
|
1004 |
| - // Reference the package, add it to restore sources, and use a test-specific packages folder |
| 1006 | + // Reference the package, add it to restore sources, and use a test-specific packages folder |
1005 | 1007 | testProject.PackageReferences.Add(package);
|
1006 | 1008 | testProject.AdditionalProperties["RestoreAdditionalProjectSources"] = Path.GetDirectoryName(package.NupkgPath);
|
1007 | 1009 | testProject.AdditionalProperties["RestorePackagesPath"] = @"$(MSBuildProjectDirectory)\packages";
|
@@ -1054,7 +1056,7 @@ public void It_does_not_warn_on_rids_if_no_framework_references()
|
1054 | 1056 | IsExe = true
|
1055 | 1057 | };
|
1056 | 1058 |
|
1057 |
| - // Reference the package, add it to restore sources, and use a test-specific packages folder |
| 1059 | + // Reference the package, add it to restore sources, and use a test-specific packages folder |
1058 | 1060 | testProject.PackageReferences.Add(package);
|
1059 | 1061 | testProject.AdditionalProperties["RestoreAdditionalProjectSources"] = Path.GetDirectoryName(package.NupkgPath);
|
1060 | 1062 | testProject.AdditionalProperties["RestorePackagesPath"] = @"$(MSBuildProjectDirectory)\packages";
|
|
0 commit comments